UCLA Academic Technology Services HomeServicesClassesContactJobs

SPSS Code Fragment
An example in SPSS macro programming

define !es (nobs=!TOKENS(1)
/group=!TOKEN(1)
/vnames=!CMDEND) 
compute nobreak = 1.
/* looping through all the variables */

!DO !vname !IN (!vnames) 
!LET !f=!CONCAT("f", !vname)
!LET !g=!CONCAT("g", !vname)
!LET !s=!CONCAT("s", !vname)
glm
  !vname  BY nobreak
  /METHOD = SSTYPE(3)
  /INTERCEPT = INCLUDE
  /SAVE  = PRED (!f ) 
	     SEPRED (!s)
  /CRITERIA = ALPHA(.05)
  /DESIGN = nobreak .
glm
  !vname  BY !group
  /METHOD = SSTYPE(3)
  /INTERCEPT = INCLUDE
  /SAVE  = PRED (!g)
  /CRITERIA = ALPHA(.05)
  /DESIGN = campus .
  compute !vname = (!g - !f)/(!s*sqrt(!nobs)).
  execute.
!DOEND 
means
tables =!vnames  by !group
/cells mean .
!enddefine.
*example: 
!es nobs=30  group=campus vnames=q2 q3 q4 q10. 

How to cite this page

Report an error on this page

UCLA Researchers are invited to our Statistical Consulting Services
We recommend others to our list of Other Resources for Statistical Computing Help
These pages are Copyrighted (c) by UCLA Academic Technology Services


The content of this web site should not be construed as an endorsement of any particular web site, book, or software product by the University of California.