Re: [R] Diverging results with SPSS

From: Celso Barros <celso.barros_at_gmail.com>
Date: Sat 08 Jul 2006 - 01:52:01 EST

Dear Peter and Florian,

      I think you have spotted the problem, thank you very much. I checked the frequencies, and R is not understanding that the (-1) value in a binary variable was defined in SPSS as "sysmis". This was precisely the variable that showed the larger difference (it's the only binary variable in the model). Thanks a lot.

      I am still trying to make R understand that, though. If I could avoid defining missing values inside R for each of the variables in the dataset, I would be happy. Does anyone know if there is a command in foreign, for instance, that ensures that things coded as sysmis in SPSS are read as sysmis in R?

      Thanks again, this has been very, very helpful

Celso

On 7/7/06, Florian Koller <fkoller@isr.umich.edu> wrote:
>
> If results are *very* different, I would suspect that R treated
> "experien" as a factor (when you use "read.spss" the default is to use
> value labels, which makes R treat such variables as factors --> set "
> use.value.labels = F").
> Another explanation could be missing data in SPSS (not sysmis, but coded
> with, say -99) that are not recognized by R.
>
> Florian
>
> ------------------------------
> *Von:* r-help-bounces@stat.math.ethz.ch im Auftrag von Celso Barros
> *Gesendet:* Fr 07.07.2006 07:13
> *An:* r-help@stat.math.ethz.ch
> *Betreff:* [R] Diverging results with SPSS
>
>
>
> Dear List,
>
> I apologize in advance if this is silly. I tried to replicate an analysis
> I
> did previously in SPSS using R, and was surprised to find different
> results.
>
>
> So my question is: shouldn't the following SPSS syntax
>
>
> REGRESSION
>
> DEPENDENT INC89
>
> /METHOD=ENTER hiedyrs experien SE93rec.
>
> Yeld the same results of the following R command
>
> modelB<-lm(INC89~HIEDYRS+EXPERIEN+SE93REC)
>
>
> I assume the is some difference in some default options.Or maybe it was a
> problem when the data was imported. After using the read.spss in the
> foreign
> package, I got the following warning message:
>
> Unrecognized record type 7, subtype 16 encountered in system file
>
> Thanks in advance for the help and apologies for the trouble,
>
>
> Celso
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help@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<http://www.r-project.org/posting-guide.html>
>
>

        [[alternative HTML version deleted]]



R-help@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 Received on Sat Jul 08 02:05:40 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Sat 08 Jul 2006 - 02:17:14 EST.

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