[R] Problem while working with SPSS data

From: Arun Kumar Saha <arun.kumar.saha_at_gmail.com>
Date: Sun, 27 May 2007 10:50:44 +0530


Dear all R users,

I got a strange problem while working with SPSS data :

I wrote following :

library(foreign)
data.original = as.data.frame(read.spss(file="c:/Program Files/SPSS/Employee data.sav"))

data = as.data.frame(cbind(data.original$MINORITY, data.original$EDUC, data.original$PREVEXP, data.original$JOBCAT, data.original$GENDER)) colnames(data) = c('MINORITY', 'EDUC', 'PREVEXP', 'JOBCAT', 'GENDER')

head( data.original)

  ID GENDER BDATE EDUC JOBCAT SALARY SALBEGIN JOBTIME PREVEXP MINORITY
1 1 <NA> 11654150400 15 Manager 57000 27000 98 144 No
2 2 <NA> 11852956800 16 Clerical 40200 18750 98 36 No
3 3 <NA> 10943337600 12 Clerical 21450 12000 98 381 No
4 4 <NA> 11502518400 8 Clerical 21900 13200 98 190 No
5 5 <NA> 11749363200 15 Clerical 45000 21000 98 138 No
6 6 <NA> 11860819200 15 Clerical 32100 13500 98 67 No

 head( data)
  V1 V2 V3 V4 V5

1 1 5 144 4 NA
2 1 6 36 2 NA
3 1 3 381 2 NA
4 1 2 190 2 NA
5 1 5 138 2 NA
6 1 5 67 2 NA

here I got the values of variable "V2" as 5,6,3,...........etc which should

be 15,16,12,....................

can anyone tell me why I got that?

And my second question is that in my "data.original" why I got the values of "GENDER" as NA? Is there any way to get the actual values i.e. "m", and "f"?

Thanks
Arun

        [[alternative HTML version deleted]]



R-help_at_stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Sun 27 May 2007 - 05:24:05 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sun 27 May 2007 - 11:31:24 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.