Skip to content

Memisc package: imported varibles from SPSS have got wrong measurement

4 messages · David Winsemius, Paul Bivand, Marion Wenty

#
On Jul 25, 2012, at 9:48 AM, Marion Wenty wrote:

            
The memisc package help file for spss.system.file() (actually labeled  
"importers") says that there is an S4 method for "subset" there does  
not seem to be a separate page describing its behavior or values
What does that phrase mean? What code did you actually use?
Hard to say. There is no R storage mode that is called "nominal".  
Perhaps some sort of memisc-specific terminology? Or perhaps something  
in your spss dataset... to which you have not provided access? Or the  
default setting for the spss.system.file access method?  I know that  
the Hmisc package's describe() function will report out a variable as  
though it were categorical if there are only 8 or fewer unique values.

After looking at further help pages and trying the help pages code, I  
am guessing that some of my puzzlement might be answered by reading  
the vignettes, but you can do that yourself.

Here's a hackish guess ... try:

?measurement
measurement(mz$age_variable) <- "interval"
# where age_variable is the unstated item in that "select" list
#
David's ?measurement
measurement(mz$age_variable) <- "interval"
# where age_variable is the unstated item in that "select" list
is what I use in similar circumstances.

Where it seems to come from is the SPSS users habit of setting value
labels on various categories of user-missing values - so a survey will
commonly have no actual missings (in spss, system-missing) but -9 as
'refused', -8 as 'not contactable' and so on. The importer picks up
the existence of value labels and sets the mode as "nominal" - which
gets transformed into factor in R usage - using base read.spss would
be likely to read these in as factor.

For analysis purposes, these values would be likely to be NA, but it
may be important to record that you were making that change.
On 26 July 2012 01:35, David Winsemius <dwinsemius at comcast.net> wrote:
1 day later