0byt3m1n1
Path:
C:
/
Users
/
Administrator
/
SYSTAT
/
SYSTAT_13
/
Gallery
/
[
Home
]
File: Partial Correlations.syc
REM This example was created using USSTATES, with ACCIDENT as the, dependent variable, and LANDAREA, POP90, and HOSPITAL as the, independent variables. TOKEN TOKEN &message / TYPE = MESSAGE PROMPT = 'This item estimates a, regression model, saves partial residuals, and uses the, partial residuals to compute the partial correlations, of the independent variables. Three temporary files, containing necessary statistics are created but are, subsequently deleted. Upon completion, no data file is, open.' TOKEN &depvar / TYPE = NVARIABLE PROMPT = 'Select a dependent variable.', IMMEDIATE TOKEN &indepvars / TYPE = NMULTIVAR SEPARATOR = '+' PROMPT = 'Select, the independent variables.' IMMEDIATE TOKEN &nvars / TYPE = INTEGER PROMPT = 'Specify the number of, independent variables in the model.' IMMEDIATE TOKEN &ndecs / TYPE = INTEGER PROMPT = 'Specify the number of decimal, places for display of partial correlations.' IMMEDIATE TOKEN &outfresid / TYPE = SAVE PROMPT = 'Specify a file for saving, Regression residuals.' TOKEN &outfcorr / TYPE = SAVE PROMPT = 'Specify a file for saving, Pearson Correlation results.' TOKEN &outfmatrix / TYPE = SAVE PROMPT = 'Specify a file for saving, Matrix procedure results.' GLM MODEL &depvar = CONSTANT + &indepvars WORK &outfresid / PARTIAL ESTIMATE OUTPUT / NOSCREEN PUSH ALL GRAPH NONE CORR USE &outfresid / NONAMES WORK &outfcorr PEARSON ypartial(1 .. &nvars) * xpartial(1 .. &nvars) GRAPH USE &outfcorr DELETE COL = xpartial(1 .. &nvars) DELETE ROWS = 1 .. &nvars DWORK &outfcorr USE &outfcorr / MATRIX = a MAT b = DIAG(a) MAT c = SHAPE(b, &nvars, 1) MWORK &outfmatrix / MATRIX = c USE &outfmatrix / NONAMES FORMAT 0 LET case$ = LFT$(STR$(case())) LET partcorr = C_1 LET variance = (partcorr ^ 2) * 100 MDELETE COL = C_1 FORMAT &ndecs OUTPUT PRINT 'Independent Variable: ', case$, , 'Partial Correlation: ', partcorr, , 'Percentage Variance: ', variance POP ALL TOKEN