Hi, I have one doubt about one of the parameter of 'read.spss()' from 'foreign' package. Here is the syntax :- read.spss ( file, use.value.labels = TRUE, to.data.frame = FALSE, max.value.labels = Inf, trim.factor.names = FALSE, trim_values = TRUE, reencode = NA, use.missings = to.data.frame ) In above syntax when I pass *'to.data.frame= FALSE*' it gives me missing values from SPSS file (that I try to read using read.spss() ). But when I pass '*to.data.frame = TRUE*' then its not giving me missing values. And need to get missing values. According to read.spss() documentation *to.data.frame : return a data frame?* I am curious to know, if we pass *'to.data.frame = TRUE*' , is it going to cause some issue or effect something? I didn't understand the read.spss() documentation correctly. Please explain. Thanks in Advance -- SG [[alternative HTML version deleted]]
Hi, if you specify to.data.frame=T, then "use.missings" is implictly set to T as well, which causes different results for (user-defined) missing values. cheers. Am 11.10.2011 12:07, schrieb Smart Guy:> Hi, > I have one doubt about one of the parameter of 'read.spss()' from > 'foreign' package. > Here is the syntax :- > > read.spss ( file, > use.value.labels = TRUE, > to.data.frame = FALSE, > max.value.labels = Inf, > trim.factor.names = FALSE, > trim_values = TRUE, > reencode = NA, > use.missings = to.data.frame ) > > > In above syntax when I pass *'to.data.frame= FALSE*' it gives me missing > values from SPSS file (that I try to read using read.spss() ). But when I > pass '*to.data.frame = TRUE*' then its not giving me missing values. And > need to get missing values. > > According to read.spss() documentation > > *to.data.frame : return a data frame?* > > I am curious to know, if we pass *'to.data.frame = TRUE*' , is it going to > cause some issue or effect something? I didn't understand the read.spss() > documentation correctly. > Please explain. > > Thanks in Advance >-- Eik Vettorazzi Department of Medical Biometry and Epidemiology University Medical Center Hamburg-Eppendorf Martinistr. 52 20246 Hamburg T ++49/40/7410-58243 F ++49/40/7410-57790 -- Pflichtangaben gem?? Gesetz ?ber elektronische Handelsregister und Genossenschaftsregister sowie das Unternehmensregister (EHUG): Universit?tsklinikum Hamburg-Eppendorf; K?rperschaft des ?ffentlichen Rechts; Gerichtsstand: Hamburg Vorstandsmitglieder: Prof. Dr. Guido Sauter (Vertreter des Vorsitzenden), Dr. Alexander Kirstein, Joachim Pr?l?, Prof. Dr. Dr. Uwe Koch-Gromus
On 11.10.2011 12:07, Smart Guy wrote:> Hi, > I have one doubt about one of the parameter of 'read.spss()' from > 'foreign' package. > Here is the syntax :- > > read.spss ( file, > use.value.labels = TRUE, > to.data.frame = FALSE, > max.value.labels = Inf, > trim.factor.names = FALSE, > trim_values = TRUE, > reencode = NA, > use.missings = to.data.frame ) > > > In above syntax when I pass *'to.data.frame= FALSE*' it gives me missing > values from SPSS file (that I try to read using read.spss() ). But when I > pass '*to.data.frame = TRUE*' then its not giving me missing values. And > need to get missing values. > > According to read.spss() documentation > > *to.data.frame : return a data frame?* > > I am curious to know, if we pass *'to.data.frame = TRUE*' , is it going to > cause some issue or effect something? I didn't understand the read.spss() > documentation correctly. > Please explain. > > Thanks in Advance >An R data.frame cannot represent different kinds of missing values, since R just has "NA". Therefore, there are two way to import data: to.data.frame=FALSE will read all the information, but into a format you will likely have to postprocess to make it conveniently usable. to.data.frame=TRUE will import into a data.frame, but that cannot represent all the nuances known from the SPSS representation. Uwe Ligges
I see, I struggle too with SPSS. But I use this company for help: http://www.ivoryresearch.com/custom-statistical-services-spss.php they are really helpful -- View this message in context: http://r.789695.n4.nabble.com/need-help-on-read-spss-tp3893430p3921825.html Sent from the R help mailing list archive at Nabble.com.
Try the memisc package which seems to have an independent implementation from PSPP (at least looks that way when compiling on linux) plus the ability to select variables before reading in the entire dataset. Paul Bivand --------------------------------------------------------- Paul Bivand Head of Analysis and Statistics Inclusion 3rd floor, 89 Albert Embankment, London SE1 7TP On 20 October 2011 14:06, Georgie <georgie.porgey at yahoo.co.uk> wrote:> I see, I struggle too with SPSS. But I use this company for help: > http://www.ivoryresearch.com/custom-statistical-services-spss.php they are > really helpful > > -- > View this message in context: http://r.789695.n4.nabble.com/need-help-on-read-spss-tp3893430p3921825.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at r-project.org 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. >