Diff for "FAQ/spsspoly" - CBU statistics Wiki
location: Diff for "FAQ/spsspoly"
Differences between revisions 1 and 2
Revision 1 as of 2009-01-16 16:13:48
Size: 945
Editor: PeterWatson
Comment:
Revision 2 as of 2009-01-16 16:15:46
Size: 1063
Editor: PeterWatson
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
Line 4: Line 3:
Thanks to Jarlath Quinn of SPSS for the syntax below. You need SPSS version 16 or above to use this syntax and follow [attachment:RinSPSS.pdf these guidelines] for using R Thanks to Jarlath Quinn of SPSS for the syntax below. You need SPSS version 16 or above to use this syntax and follow [attachment:RinSPSS.pdf these guidelines] for using R code in SPSS. You can alternatively run the R code in R.
The example data file is [attachment:polydat.sav given here.]

Using R within SPSS to obtain polychoric correlations

Thanks to Jarlath Quinn of SPSS for the syntax below. You need SPSS version 16 or above to use this syntax and follow [attachment:RinSPSS.pdf these guidelines] for using R code in SPSS. You can alternatively run the R code in R. The example data file is [attachment:polydat.sav given here.]

GET
  FILE='C:\SE demos\Assess\demo dataset v4.sav'.
DATASET NAME $DataSet WINDOW=FRONT.

begin program r.
library(polycor)
casedata <- spssdata.GetDataFromSPSS(variables=c(9,10,11,12))
satcat<-as.factor(casedata$satcat)
sat <- casedata$sat
perf_2 <- casedata$perf_2
perf_3 <- casedata$perf_3
res <- hetcor(satcat, sat, perf_2, perf_3, ML = FALSE,std.err = FALSE, bins=4)
spsspivottable.Display(res$correlations,
                                          title="Correlation Matrix",
                                          rowdim=" ",
                                          coldim="col",
                                          format=formatSpec.Correlation)
end program.

None: FAQ/spsspoly (last edited 2013-03-08 10:17:37 by localhost)