Example 10: Use Parts of Output - XML
{"Image DocumentName": "Example 10: Use Parts of Output - XML", "Image ImageDescription": "Run regression; get selected statistics, but do not display the regular Regression output. Use OMS and Xpath wrapper functions. BEGIN PROGRAM. import spss, spssaux. spssaux.OpenDataFile( SPSSDIR/CARS.SAV ) try: handle, failcode = spssaux.CreateXMLOutput(\\ REGRESSION /DEPENDENT accel /METHOD=ENTER weight horse year. , visible=False) horseCoef = spssaux.GetValuesFromXMLWorkspace(\\ handle, Coefficients , rowCategory= Horsepower , colCategory= B ,cellAttrib= number ) print The effect of horsepower on acceleration is: , horseCoef. Rsq = spssaux.GetValuesFromXMLWorkspace(\\ handle, Model Summary , colCategory= R Square , cellAttrib= text ) print The R square is: , Rsq. spss.DeleteXPathHandle(handle) except: print     Regression command failed. No results available. raise. END PROGRAM. Example assumes that SPSS Output Labels are set to Labels , not Names . A later example will show this using datasets instead of XML. Run. Copyright (c) SPSS Inc, 2006.", "Image XResolution": "37", "Image YResolution": "37", "Image ResolutionUnit": "Pixels/Centimeter", "Image Software": "SlidePlayer", "Image YCbCrPositioning": "Centered"}