Administrator
|
Inspired by the previous thread: http://spssx-discussion.1045642.n5.nabble.com/Syntax-question-Replication-analysis-tp5512075p5512075.html
I figured a followup with implementation of my suggestions would be in order. ************************************ *************************************************************************************. *JACKKNIFE STATISTICS for Linear Multiple Regression by David Marso *. * Code posted (ASIS): No Warranties, blah blah blah... Use at your own risk, RTFM etc!!!. * Code adapted from posting by Marta García-Granero. * http://spssx-discussion.1045642.n5.nabble.com/Syntax-question-Replication-analysis-tp5512075p5512356.html * Modifications: * 1. Added 95% Confidence intervals to 'Full Sample Statistics'. * 2. Removed explicit sample construction in lieu of JK Betas computed from REGRESSION DFBeta (b-DFBeta). * 3. R square and Adjusted R Square computed by Updating of X'Y and Y'Y for each case. * 4. Added a parameter (Nrept) to permit flexibity in number of JK case rows to present. * 5. Added Min, Max, Mean and SD table. *************************************************************************************. * Matrix code for computation of 95% Critical value for t statistic given df. * This is a substitute for the curiously 'missing' TIDF from the MATRIX language ;-). *NOTE: This is a FRAGMENT which should only be called from an existing MATRIX program. *************************************************************************************. DEFINE TIDF95 (DF !TOKENS(1) /OUT !TOKENS(1)). COMPUTE TCrit975= {12.70620,4.30265,3.18245,2.77645,2.57058,2.44691,2.36462,2.30600,2.26216,2.22814, 2.20099,2.17881,2.16037,2.14479,2.13145,2.11991,2.10982,2.10092,2.09302,2.08596, 2.07961,2.07387,2.06866,2.06390,2.05954,2.05553,2.05183,2.04841,2.04523,2.04227, 2.02108,2.00856,2.00030,1.99006,1.98397,1.97993,1.96000 }. COMPUTE df=!df. COMPUTE Start=0. DO IF df <=30. + COMPUTE tval975=TCrit975(df). ELSE IF (df=40 OR df=50 OR df=60 OR df=80 OR df=100 OR df=120). + COMPUTE tval975=MMAX({TCrit975(31)*(df=40),TCrit975(32)*(df=50),TCrit975(33)*(df=60),TCrit975(34)*(df=80),TCrit975(35)*(df=100),TCrit975(36)*(df=120)}). ELSE. + COMPUTE START=MMAX({(df GE 31 AND df LE 39)*30,(df GE 41 AND df LE 49)*31,(df GE 51 AND df LE 59)*32,(df GE 61 AND df LE 79)*33, (df GE 81 AND df LE 99)*34,(df GE 101 AND df LE 119)*35,(df > 120)*36}). END IF. DO IF (Start NE 0). * Loop code adapted from Marta García-Granero. * http://spssx-discussion.1045642.n5.nabble.com/Inclusion-of-IDF-functions-in-matrix-language-td4680040.html. + LOOP TCheck=TCrit975(START+1)*10000 TO TCrit975(START)*10000. + DO IF abs(tcdf(tCheck/10000,df)-0.975) lt 0.000005. + COMPUTE tval975=TCheck/10000. + BREAK. + END IF. + END LOOP. END IF. COMPUTE !OUT=tval975 . !ENDDEFINE. *************************************************************************************. DEFINE JKMLRDMM(y=!TOKENS(1) / x=!CHAREND ("/") / NRept !TOKENS(1) !DEFAULT (10) ). SET MXLOOPS=10000. /* Should be at least equal to sample size *. * Uncomment the following line if you wish to supress the Regression Output*. PRESERVE. *********************************. * This step uses SPSS 14/Newer *. DATASET NAME OriginalData. *********************************. *SET RESULTS=OFF ERRORS=OFF. REGRESSION /STAT DEF CI/DEP !Y / METHOD ENTER !X / SAVE DFBETA (DFBX). SET RESULTS=ON ERRORS=ON. TEMPORARY. NUMERIC @. MATRIX. * Input data (DV goes first) with listwise deletion *. GET data /VAR=!y !x/MISSING=OMIT/NAME=vnames. GET DFBeta /VAR dfbx0 TO @ /FILE */ MISSING=ACCEPT/SYSMIS=-999999. COMPUTE DFBeta=DFBeta(:,1:(NCOL(DFBETA)-1)). * Full sample statistics *. COMPUTE n=NROW(data). COMPUTE p=NCOL(data). /* Number. of parameters (with constant) *. COMPUTE x={MAKE(n,1,1),data(:,(2:p))}. /* Split data into "y" and "x" matrices with Constant as first column*. COMPUTE y=data(:,1). COMPUTE XTX=T(X)*X. COMPUTE TXY=T(X)*Y. COMPUTE TYY=T(Y)*Y. COMPUTE meany=TXY(1,1)/n. COMPUTE GINVXTX= GINV(XTX). COMPUTE b = GINVXTX * TXY. /* Note:GINV(x)=INV[T(x)*x]*T(x) *. COMPUTE ESS = T(b)*TXY-n*meany&**2. /* Model Sum of Squares *. COMPUTE TSS = TYY-n*meany&**2. /* Total Sum of Squares *. COMPUTE sigma2 = (TSS-ESS)/(n-p). /* Residual variance *. COMPUTE SEb = SQRT(DIAG(sigma2*GINVXTX)). /* SE of coefficients *. COMPUTE tvalue = b/SEb. COMPUTE df = n-p. COMPUTE tsig=2*(1-TCDF(ABS(tvalue),df)). **Call the matrix fragment to obtaing 95% critical value for t (df). TIDF95 df=df OUT =tcrit. COMPUTE LCL=b-tcrit*seb. COMPUTE UCL=b+tcrit*seb. COMPUTE Rsquare=ESS/TSS. COMPUTE Psquare=1-(1-rsquare)*(n-1)/(n-p). COMPUTE Fvalue=(rsquare/(p-1))/((1-rsquare)/(n-p)). COMPUTE Fsig=1-FCDF(Fvalue,(p-1),(n-p)). * Reports *. COMPUTE vnames={'Constant',vnames(2:p)}. PRINT /TITLE='Full sample statistics'. PRINT {b,SEb,tvalue,tsig,LCL,UCL} /FORMAT='F8.3' /RNAMES=vnames /CLABEL='Coeff.','SE','T','Sig.','95% LCL','95% UCL' /TITLE='Unstandardized coefficients'. PRINT {rsquare,psquare,SQRT(sigma2)}/FORMAT='F8.3'/CLABEL='RSq.','AdjRSq.','Res(SD)'/TITLE='Model Summary'. PRINT {Fvalue,Fsig}/FORMAT='F8.4'/CLABEL='F value','Sig.'/TITLE='R-square test (F value & Significance)'. * JACKKNIFE STATISTICS *. COMPUTE nj=n-1. /* New sample size *. * Compute empty matrix to store JK statistics *. COMPUTE JackStat=MAKE(n,(p+2),0). * Cycle thru all values *. COMPUTE nj1njp=(nj-1)/(nj-p). LOOP i=1 TO n. . COMPUTE CM=nj*((meany*n-y(i,:))/nj)&**2. . COMPUTE Tbi=T(b)-DFBETA(i,:). . COMPUTE ESS=Tbi*(TXY-T(X(i,:))*Y(i))-CM) . . COMPUTE TSS=(TYY-Y(i)*Y(i)-CM) . * Store all statistics in JackStat(i) *. . COMPUTE JackStat(i,1) = ESS/TSS . . COMPUTE JackStat(i,2) = 1-(1-JackStat(i,1))*nj1njp . . COMPUTE Jackstat(i,3:(p+2)) = Tbi. ** ADD ANY OTHER STATISTICS YOU THINK RELEVANT HERE* ** Just need an expression to update from TOTAL to Leaving one out*. END LOOP. * Calculate Min, Max, Mean and SD for JackKnife statistics *. . COMPUTE Stats=CMIN(JackStat). . COMPUTE Stats={Stats;CMAX(JackStat)}. . COMPUTE Stats={Stats;CSUM(JackStat)/n}. . COMPUTE Stats={Stats;CSSQ(JackStat)-N*Stats(3,:)&**2}. . COMPUTE Stats(4,:)=SQRT(Stats(4,:)/(n-1)). COMPUTE AllNames={'R2','P2',vnames}. COMPUTE ROWID={"Min", "Max", "Mean", "Std Dev"}. COMPUTE JackStat={T({1:NROW(JackStat)}),JackStat}. PRINT Stats /FORMAT='F8.3' /CNAMES=AllNames /RNAMES=RowID /TITLE='Min, Max, Mean, Std Dev of Jackknife statistics'. * Report first Nrept values *. COMPUTE ClNames={"CaseID",AllNames}. PRINT {JackStat(1:!Nrept,:)} /FORMAT='F8.3' /CNAMES=ClNames /TITLE=!QUOTE(!CONCAT('Jackknife statistics for rows 1-',!NRept)). * Export JK statistics to active dataset *. COMPUTE JackStat=JackStat(:,2:NCol(JackStat)). SAVE JackStat /OUTFILE='Coefficients.sav' /Variables R2 P2 Constant !X. PRINT /TITLE='Jackknife statistics exported to Coefficients Dataset'. END MATRIX. RESTORE. GET FILE 'Coefficients.sav'. * This part uses SPSS 14/Newer *. ********************************. DATASET NAME Coefficients. ********************************. FORMAT ALL (F8.3). VAR LABEL R2 'R Square'/P2 'Adj.R Square'. FREQUENCIES VAR=ALL /FORMAT=NOTABLE /PERCENTILES= 2.5 25 50 75 97.5 /STATISTICS=STDDEV MINIMUM MAXIMUM MEAN. * This part uses SPSS 14/Newer *. ********************************. DATASET ACTIVATE OriginalData. ** Uncomment following line if you wish the JK Coefficients File to remain open. DATASET CLOSE Coefficients. ********************************. !ENDDEFINE. * Sample dataset (50 random cases from Rosner's dataset FEV.sav) *. DATA LIST FREE/fev(F8.3) age(F8.0) hgt(F8.1) gender smoke (2 F8.0). BEGIN DATA 1.415 6 56.0 0 0 2.646 10 60.0 1 0 3.519 19 66.0 0 1 3.000 9 65.5 1 0 3.428 14 64.0 0 1 1.694 11 60.0 1 1 3.957 14 72.0 1 1 1.962 8 57.0 1 0 2.384 12 63.5 0 1 2.679 15 66.0 0 1 2.387 10 66.0 0 1 1.794 8 54.5 1 0 2.646 13 61.5 0 0 2.198 15 62.0 0 1 3.345 19 65.5 0 1 2.599 13 62.5 0 1 3.082 17 67.0 1 1 2.903 16 63.0 0 1 3.004 15 64.0 0 1 1.603 7 51.0 0 0 1.196 5 46.5 0 0 1.697 8 59.0 0 0 2.813 10 61.5 0 0 3.985 15 71.0 1 0 4.309 14 69.0 1 1 1.947 9 56.5 0 0 3.169 11 62.5 0 1 3.406 17 69.0 1 1 2.358 10 59.0 0 0 1.933 9 58.0 0 0 3.297 13 65.0 0 1 3.680 14 67.0 1 0 1.953 9 58.0 1 1 3.247 11 65.5 1 0 4.086 18 67.0 1 1 3.585 14 70.0 1 0 3.498 10 68.0 1 1 2.953 11 67.0 0 1 3.127 10 62.0 1 0 1.338 6 51.5 0 0 2.569 12 63.0 0 0 3.320 11 65.5 1 0 3.780 14 70.0 1 0 4.404 18 70.5 1 1 4.637 11 72.0 1 1 3.727 15 68.0 1 1 4.203 12 71.0 1 0 2.564 7 58.0 0 0 3.152 13 62.0 0 1 2.391 10 59.5 1 0 END DATA. VAR LABEL fev 'FEV (liters)' /age 'Age (years)' /hgt 'Height (inches)'. VALUE LABEL gender 0 'Female' 1 'Male' /smoke 0'Non Smoker' 1'Smoker'. VAR LEV gender smoke (NOMINAL). * Adding an interaction term to the model *. COMPUTE smokehgt=smoke*hgt. FORMAT smokehgt (F8). JKMLRDMM y=fev x=age hgt gender smoke smokehgt / Nrept 40.
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me. --- "Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis." Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?" |
Pretty cool David!
Since you have everything under control and my hands are full of "SPSS to Stata" conversion of many years of my work (suppressed sob), I suppose that all the questions that other listers asked concerning my earlier post are now answered. Bet regards, Marta El 28/02/2012 17:20, David Marso escribió: > Inspired by the previous thread: > http://spssx-discussion.1045642.n5.nabble.com/Syntax-question-Replication-analysis-tp5512075p5512075.html > I figured a followup with implementation of my suggestions would be in > order. > ************************************ > *************************************************************************************. > *JACKKNIFE STATISTICS for Linear Multiple Regression by David Marso > *. > * Code posted (ASIS): No Warranties, blah blah blah... Use at your own risk, > RTFM etc!!!. > * Code adapted from posting by Marta García-Granero. > * > http://spssx-discussion.1045642.n5.nabble.com/Syntax-question-Replication-analysis-tp5512075p5512356.html > * Modifications: > * 1. Added 95% Confidence intervals to 'Full Sample Statistics'. > * 2. Removed explicit sample construction in lieu of JK Betas computed from > REGRESSION DFBeta (b-DFBeta). > * 3. R square and Adjusted R Square computed by Updating of X'Y and Y'Y for > each case. > * 4. Added a parameter (Nrept) to permit flexibity in number of JK case rows > to present. > * 5. Added Min, Max, Mean and SD table. > *************************************************************************************. > * Matrix code for computation of 95% Critical value for t statistic given > df. > * This is a substitute for the curiously 'missing' TIDF from the MATRIX > language ;-). > *NOTE: This is a FRAGMENT which should only be called from an existing > MATRIX program. > *************************************************************************************. > DEFINE TIDF95 (DF !TOKENS(1) /OUT !TOKENS(1)). > COMPUTE TCrit975= > {12.70620,4.30265,3.18245,2.77645,2.57058,2.44691,2.36462,2.30600,2.26216,2.22814, > > 2.20099,2.17881,2.16037,2.14479,2.13145,2.11991,2.10982,2.10092,2.09302,2.08596, > > 2.07961,2.07387,2.06866,2.06390,2.05954,2.05553,2.05183,2.04841,2.04523,2.04227, > 2.02108,2.00856,2.00030,1.99006,1.98397,1.97993,1.96000 > }. > COMPUTE df=!df. > COMPUTE Start=0. > DO IF df<=30. > + COMPUTE tval975=TCrit975(df). > ELSE IF (df=40 OR df=50 OR df=60 OR df=80 OR df=100 OR df=120). > + COMPUTE > tval975=MMAX({TCrit975(31)*(df=40),TCrit975(32)*(df=50),TCrit975(33)*(df=60),TCrit975(34)*(df=80),TCrit975(35)*(df=100),TCrit975(36)*(df=120)}). > ELSE. > + COMPUTE START=MMAX({(df GE 31 AND df LE 39)*30,(df GE 41 AND df LE > 49)*31,(df GE 51 AND df LE 59)*32,(df GE 61 AND df LE 79)*33, > (df GE 81 AND df LE 99)*34,(df GE 101 AND df LE > 119)*35,(df> 120)*36}). > END IF. > > DO IF (Start NE 0). > * Loop code adapted from Marta García-Granero. > * > http://spssx-discussion.1045642.n5.nabble.com/Inclusion-of-IDF-functions-in-matrix-language-td4680040.html. > + LOOP TCheck=TCrit975(START+1)*10000 TO TCrit975(START)*10000. > + DO IF abs(tcdf(tCheck/10000,df)-0.975) lt 0.000005. > + COMPUTE tval975=TCheck/10000. > + BREAK. > + END IF. > + END LOOP. > END IF. > COMPUTE !OUT=tval975 . > !ENDDEFINE. > *************************************************************************************. > DEFINE JKMLRDMM(y=!TOKENS(1) / x=!CHAREND ("/") / NRept !TOKENS(1) !DEFAULT > (10) ). > SET MXLOOPS=10000. /* Should be at least equal to sample size *. > * Uncomment the following line if you wish to supress the Regression > Output*. > PRESERVE. > *********************************. > * This step uses SPSS 14/Newer *. > DATASET NAME OriginalData. > *********************************. > *SET RESULTS=OFF ERRORS=OFF. > REGRESSION /STAT DEF CI/DEP !Y / METHOD ENTER !X / SAVE DFBETA (DFBX). > SET RESULTS=ON ERRORS=ON. > TEMPORARY. > NUMERIC @. > MATRIX. > * Input data (DV goes first) with listwise deletion *. > GET data /VAR=!y !x/MISSING=OMIT/NAME=vnames. > GET DFBeta /VAR dfbx0 TO @ /FILE */ MISSING=ACCEPT/SYSMIS=-999999. > COMPUTE DFBeta=DFBeta(:,1:(NCOL(DFBETA)-1)). > * Full sample statistics *. > COMPUTE n=NROW(data). > COMPUTE p=NCOL(data). /* Number. of parameters (with > constant) *. > COMPUTE x={MAKE(n,1,1),data(:,(2:p))}. /* Split data into "y" and "x" > matrices with Constant as first column*. > COMPUTE y=data(:,1). > COMPUTE XTX=T(X)*X. > COMPUTE TXY=T(X)*Y. > COMPUTE TYY=T(Y)*Y. > COMPUTE meany=TXY(1,1)/n. > COMPUTE GINVXTX= GINV(XTX). > COMPUTE b = GINVXTX * TXY. /* > Note:GINV(x)=INV[T(x)*x]*T(x) *. > COMPUTE ESS = T(b)*TXY-n*meany&**2. /* Model Sum of Squares *. > COMPUTE TSS = TYY-n*meany&**2. /* Total Sum of Squares *. > COMPUTE sigma2 = (TSS-ESS)/(n-p). /* Residual variance *. > COMPUTE SEb = SQRT(DIAG(sigma2*GINVXTX)). /* SE of coefficients *. > COMPUTE tvalue = b/SEb. > COMPUTE df = n-p. > COMPUTE tsig=2*(1-TCDF(ABS(tvalue),df)). > **Call the matrix fragment to obtaing 95% critical value for t (df). > TIDF95 df=df OUT =tcrit. > COMPUTE LCL=b-tcrit*seb. > COMPUTE UCL=b+tcrit*seb. > COMPUTE Rsquare=ESS/TSS. > COMPUTE Psquare=1-(1-rsquare)*(n-1)/(n-p). > COMPUTE Fvalue=(rsquare/(p-1))/((1-rsquare)/(n-p)). > COMPUTE Fsig=1-FCDF(Fvalue,(p-1),(n-p)). > * Reports *. > COMPUTE vnames={'Constant',vnames(2:p)}. > PRINT /TITLE='Full sample statistics'. > PRINT {b,SEb,tvalue,tsig,LCL,UCL} > /FORMAT='F8.3' > /RNAMES=vnames > /CLABEL='Coeff.','SE','T','Sig.','95% LCL','95% UCL' > /TITLE='Unstandardized coefficients'. > {rsquare,psquare,SQRT(sigma2)}/FORMAT='F8.3'/CLABEL='RSq.','AdjRSq.','Res(SD)'/TITLE='Model > Summary'. > PRINT {Fvalue,Fsig}/FORMAT='F8.4'/CLABEL='F value','Sig.'/TITLE='R-square > test (F value& Significance)'. > * JACKKNIFE STATISTICS *. > COMPUTE nj=n-1. /* New sample size *. > * Compute empty matrix to store JK statistics *. > COMPUTE JackStat=MAKE(n,(p+2),0). > > * Cycle thru all values *. > COMPUTE nj1njp=(nj-1)/(nj-p). > LOOP i=1 TO n. > . COMPUTE CM=nj*((meany*n-y(i,:))/nj)&**2. > . COMPUTE Tbi=T(b)-DFBETA(i,:). > . COMPUTE ESS=Tbi*(TXY-T(X(i,:))*Y(i))-CM) . > . COMPUTE TSS=(TYY-Y(i)*Y(i)-CM) . > * Store all statistics in JackStat(i) *. > . COMPUTE JackStat(i,1) = ESS/TSS . > . COMPUTE JackStat(i,2) = 1-(1-JackStat(i,1))*nj1njp . > . COMPUTE Jackstat(i,3:(p+2)) = Tbi. > ** ADD ANY OTHER STATISTICS YOU THINK RELEVANT HERE* > ** Just need an expression to update from TOTAL to Leaving one out*. > END LOOP. > * Calculate Min, Max, Mean and SD for JackKnife statistics *. > . COMPUTE Stats=CMIN(JackStat). > . COMPUTE Stats={Stats;CMAX(JackStat)}. > . COMPUTE Stats={Stats;CSUM(JackStat)/n}. > . COMPUTE Stats={Stats;CSSQ(JackStat)-N*Stats(3,:)&**2}. > . COMPUTE Stats(4,:)=SQRT(Stats(4,:)/(n-1)). > > COMPUTE AllNames={'R2','P2',vnames}. > COMPUTE ROWID={"Min", "Max", "Mean", "Std Dev"}. > COMPUTE JackStat={T({1:NROW(JackStat)}),JackStat}. > PRINT Stats /FORMAT='F8.3' /CNAMES=AllNames /RNAMES=RowID > /TITLE='Min, Max, Mean, Std Dev of Jackknife statistics'. > * Report first Nrept values *. > COMPUTE ClNames={"CaseID",AllNames}. > PRINT {JackStat(1:!Nrept,:)} /FORMAT='F8.3' /CNAMES=ClNames > /TITLE=!QUOTE(!CONCAT('Jackknife statistics for rows 1-',!NRept)). > * Export JK statistics to active dataset *. > COMPUTE JackStat=JackStat(:,2:NCol(JackStat)). > SAVE JackStat /OUTFILE='Coefficients.sav' /Variables R2 P2 Constant !X. > PRINT /TITLE='Jackknife statistics exported to Coefficients Dataset'. > END MATRIX. > RESTORE. > GET FILE 'Coefficients.sav'. > * This part uses SPSS 14/Newer *. > ********************************. > DATASET NAME Coefficients. > ********************************. > FORMAT ALL (F8.3). > VAR LABEL R2 'R Square'/P2 'Adj.R Square'. > FREQUENCIES VAR=ALL > /FORMAT=NOTABLE > /PERCENTILES= 2.5 25 50 75 97.5 > /STATISTICS=STDDEV MINIMUM MAXIMUM MEAN. > > * This part uses SPSS 14/Newer *. > ********************************. > DATASET ACTIVATE OriginalData. > ** Uncomment following line if you wish the JK Coefficients File to remain > open. > DATASET CLOSE Coefficients. > ********************************. > !ENDDEFINE. > > * Sample dataset (50 random cases from Rosner's dataset FEV.sav) *. > DATA LIST FREE/fev(F8.3) age(F8.0) hgt(F8.1) gender smoke (2 F8.0). > BEGIN DATA > 1.415 6 56.0 0 0 2.646 10 60.0 1 0 3.519 19 66.0 0 1 3.000 9 65.5 1 0 > 3.428 14 64.0 0 1 1.694 11 60.0 1 1 3.957 14 72.0 1 1 1.962 8 57.0 1 0 > 2.384 12 63.5 0 1 2.679 15 66.0 0 1 2.387 10 66.0 0 1 1.794 8 54.5 1 0 > 2.646 13 61.5 0 0 2.198 15 62.0 0 1 3.345 19 65.5 0 1 2.599 13 62.5 0 1 > 3.082 17 67.0 1 1 2.903 16 63.0 0 1 3.004 15 64.0 0 1 1.603 7 51.0 0 0 > 1.196 5 46.5 0 0 1.697 8 59.0 0 0 2.813 10 61.5 0 0 3.985 15 71.0 1 0 > 4.309 14 69.0 1 1 1.947 9 56.5 0 0 3.169 11 62.5 0 1 3.406 17 69.0 1 1 > 2.358 10 59.0 0 0 1.933 9 58.0 0 0 3.297 13 65.0 0 1 3.680 14 67.0 1 0 > 1.953 9 58.0 1 1 3.247 11 65.5 1 0 4.086 18 67.0 1 1 3.585 14 70.0 1 0 > 3.498 10 68.0 1 1 2.953 11 67.0 0 1 3.127 10 62.0 1 0 1.338 6 51.5 0 0 > 2.569 12 63.0 0 0 3.320 11 65.5 1 0 3.780 14 70.0 1 0 4.404 18 70.5 1 1 > 4.637 11 72.0 1 1 3.727 15 68.0 1 1 4.203 12 71.0 1 0 2.564 7 58.0 0 0 > 3.152 13 62.0 0 1 2.391 10 59.5 1 0 > END DATA. > VAR LABEL fev 'FEV (liters)' /age 'Age (years)' /hgt 'Height (inches)'. > VALUE LABEL gender 0 'Female' 1 'Male' /smoke 0'Non Smoker' 1'Smoker'. > VAR LEV gender smoke (NOMINAL). > > * Adding an interaction term to the model *. > COMPUTE smokehgt=smoke*hgt. > FORMAT smokehgt (F8). > JKMLRDMM y=fev x=age hgt gender smoke smokehgt / Nrept 40. > > > > -- > View this message in context: http://spssx-discussion.1045642.n5.nabble.com/JackKnife-for-Multiple-Linear-Regression-tp5522345p5522345.html > Sent from the SPSSX Discussion mailing list archive at Nabble.com. > > ===================== > To manage your subscription to SPSSX-L, send a message to > [hidden email] (not to SPSSX-L), with no body text except the > command. To leave the list, send the command > SIGNOFF SPSSX-L > For a list of commands to manage subscriptions, send the command > INFO REFCARD > ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD |
Administrator
|
Hi Marta,
How is Stata? Seems SPSS/IBM licensing policies are going to eventually compel many others to make the transition. I myself am still using my old reliable SPSS 11.5 from 2003 (free as part of my severance from $P$$ inc.). It would cost my several K to upgrade to the current system and unless I win the lottery, that isn't going to happen. Anyhow, One thing which I think novel in my code is the creation of a "matrix function" for the TIDF. I just tried this idea one day and it worked (orphaned MATRIX bits in a separate macro rather than having the code inside the control piece. Hope you are well, David On Tue, Feb 28, 2012 at 11:50 AM, Marta García-Granero-2 [via SPSSX Discussion] <[hidden email]> wrote: > Pretty cool David! > > Since you have everything under control and my hands are full of "SPSS > to Stata" conversion of many years of my work (suppressed sob), I > suppose that all the questions that other listers asked concerning my > earlier post are now answered. > > Bet regards, > Marta > > > El 28/02/2012 17:20, David Marso escribió: > >> Inspired by the previous thread: >> >> http://spssx-discussion.1045642.n5.nabble.com/Syntax-question-Replication-analysis-tp5512075p5512075.html >> I figured a followup with implementation of my suggestions would be in >> order. >> ************************************ >> >> *************************************************************************************. >> *JACKKNIFE STATISTICS for Linear Multiple Regression by David Marso >> *. >> * Code posted (ASIS): No Warranties, blah blah blah... Use at your own >> risk, >> RTFM etc!!!. >> * Code adapted from posting by Marta García-Granero. >> * >> >> http://spssx-discussion.1045642.n5.nabble.com/Syntax-question-Replication-analysis-tp5512075p5512356.html >> * Modifications: >> * 1. Added 95% Confidence intervals to 'Full Sample Statistics'. >> * 2. Removed explicit sample construction in lieu of JK Betas computed >> from >> REGRESSION DFBeta (b-DFBeta). >> * 3. R square and Adjusted R Square computed by Updating of X'Y and Y'Y >> for >> each case. >> * 4. Added a parameter (Nrept) to permit flexibity in number of JK case >> rows >> to present. >> * 5. Added Min, Max, Mean and SD table. >> >> *************************************************************************************. >> * Matrix code for computation of 95% Critical value for t statistic given >> df. >> * This is a substitute for the curiously 'missing' TIDF from the MATRIX >> language ;-). >> *NOTE: This is a FRAGMENT which should only be called from an existing >> MATRIX program. >> >> *************************************************************************************. >> DEFINE TIDF95 (DF !TOKENS(1) /OUT !TOKENS(1)). >> COMPUTE TCrit975= >> >> {12.70620,4.30265,3.18245,2.77645,2.57058,2.44691,2.36462,2.30600,2.26216,2.22814, >> >> >> 2.20099,2.17881,2.16037,2.14479,2.13145,2.11991,2.10982,2.10092,2.09302,2.08596, >> >> >> 2.07961,2.07387,2.06866,2.06390,2.05954,2.05553,2.05183,2.04841,2.04523,2.04227, >> >> 2.02108,2.00856,2.00030,1.99006,1.98397,1.97993,1.96000 >> }. >> COMPUTE df=!df. >> COMPUTE Start=0. >> DO IF df<=30. >> + COMPUTE tval975=TCrit975(df). >> ELSE IF (df=40 OR df=50 OR df=60 OR df=80 OR df=100 OR df=120). >> + COMPUTE >> >> tval975=MMAX({TCrit975(31)*(df=40),TCrit975(32)*(df=50),TCrit975(33)*(df=60),TCrit975(34)*(df=80),TCrit975(35)*(df=100),TCrit975(36)*(df=120)}). >> ELSE. >> + COMPUTE START=MMAX({(df GE 31 AND df LE 39)*30,(df GE 41 AND df LE >> 49)*31,(df GE 51 AND df LE 59)*32,(df GE 61 AND df LE 79)*33, >> (df GE 81 AND df LE 99)*34,(df GE 101 AND df LE >> 119)*35,(df> 120)*36}). >> END IF. >> >> DO IF (Start NE 0). >> * Loop code adapted from Marta García-Granero. >> * >> >> http://spssx-discussion.1045642.n5.nabble.com/Inclusion-of-IDF-functions-in-matrix-language-td4680040.html. >> + LOOP TCheck=TCrit975(START+1)*10000 TO TCrit975(START)*10000. >> + DO IF abs(tcdf(tCheck/10000,df)-0.975) lt 0.000005. >> + COMPUTE tval975=TCheck/10000. >> + BREAK. >> + END IF. >> + END LOOP. >> END IF. >> COMPUTE !OUT=tval975 . >> !ENDDEFINE. >> >> *************************************************************************************. >> DEFINE JKMLRDMM(y=!TOKENS(1) / x=!CHAREND ("/") / NRept !TOKENS(1) >> !DEFAULT >> (10) ). >> SET MXLOOPS=10000. /* Should be at least equal to sample size *. >> * Uncomment the following line if you wish to supress the Regression >> Output*. >> PRESERVE. >> *********************************. >> * This step uses SPSS 14/Newer *. >> DATASET NAME OriginalData. >> *********************************. >> *SET RESULTS=OFF ERRORS=OFF. >> REGRESSION /STAT DEF CI/DEP !Y / METHOD ENTER !X / SAVE DFBETA (DFBX). >> SET RESULTS=ON ERRORS=ON. >> TEMPORARY. >> NUMERIC @. >> MATRIX. >> * Input data (DV goes first) with listwise deletion *. >> GET data /VAR=!y !x/MISSING=OMIT/NAME=vnames. >> GET DFBeta /VAR dfbx0 TO @ /FILE */ MISSING=ACCEPT/SYSMIS=-999999. >> COMPUTE DFBeta=DFBeta(:,1:(NCOL(DFBETA)-1)). >> * Full sample statistics *. >> COMPUTE n=NROW(data). >> COMPUTE p=NCOL(data). /* Number. of parameters (with >> constant) *. >> COMPUTE x={MAKE(n,1,1),data(:,(2:p))}. /* Split data into "y" and "x" >> matrices with Constant as first column*. >> COMPUTE y=data(:,1). >> COMPUTE XTX=T(X)*X. >> COMPUTE TXY=T(X)*Y. >> COMPUTE TYY=T(Y)*Y. >> COMPUTE meany=TXY(1,1)/n. >> COMPUTE GINVXTX= GINV(XTX). >> COMPUTE b = GINVXTX * TXY. /* >> Note:GINV(x)=INV[T(x)*x]*T(x) *. >> COMPUTE ESS = T(b)*TXY-n*meany&**2. /* Model Sum of Squares *. >> COMPUTE TSS = TYY-n*meany&**2. /* Total Sum of Squares *. >> COMPUTE sigma2 = (TSS-ESS)/(n-p). /* Residual variance *. >> COMPUTE SEb = SQRT(DIAG(sigma2*GINVXTX)). /* SE of coefficients *. >> COMPUTE tvalue = b/SEb. >> COMPUTE df = n-p. >> COMPUTE tsig=2*(1-TCDF(ABS(tvalue),df)). >> **Call the matrix fragment to obtaing 95% critical value for t (df). >> TIDF95 df=df OUT =tcrit. >> COMPUTE LCL=b-tcrit*seb. >> COMPUTE UCL=b+tcrit*seb. >> COMPUTE Rsquare=ESS/TSS. >> COMPUTE Psquare=1-(1-rsquare)*(n-1)/(n-p). >> COMPUTE Fvalue=(rsquare/(p-1))/((1-rsquare)/(n-p)). >> COMPUTE Fsig=1-FCDF(Fvalue,(p-1),(n-p)). >> * Reports *. >> COMPUTE vnames={'Constant',vnames(2:p)}. >> PRINT /TITLE='Full sample statistics'. >> PRINT {b,SEb,tvalue,tsig,LCL,UCL} >> /FORMAT='F8.3' >> /RNAMES=vnames >> /CLABEL='Coeff.','SE','T','Sig.','95% LCL','95% UCL' >> /TITLE='Unstandardized coefficients'. >> >> {rsquare,psquare,SQRT(sigma2)}/FORMAT='F8.3'/CLABEL='RSq.','AdjRSq.','Res(SD)'/TITLE='Model >> Summary'. >> PRINT {Fvalue,Fsig}/FORMAT='F8.4'/CLABEL='F value','Sig.'/TITLE='R-square >> test (F value& Significance)'. >> * JACKKNIFE STATISTICS *. >> COMPUTE nj=n-1. /* New sample size *. >> * Compute empty matrix to store JK statistics *. >> COMPUTE JackStat=MAKE(n,(p+2),0). >> >> * Cycle thru all values *. >> COMPUTE nj1njp=(nj-1)/(nj-p). >> LOOP i=1 TO n. >> . COMPUTE CM=nj*((meany*n-y(i,:))/nj)&**2. >> . COMPUTE Tbi=T(b)-DFBETA(i,:). >> . COMPUTE ESS=Tbi*(TXY-T(X(i,:))*Y(i))-CM) . >> . COMPUTE TSS=(TYY-Y(i)*Y(i)-CM) . >> * Store all statistics in JackStat(i) *. >> . COMPUTE JackStat(i,1) = ESS/TSS . >> . COMPUTE JackStat(i,2) = 1-(1-JackStat(i,1))*nj1njp . >> . COMPUTE Jackstat(i,3:(p+2)) = Tbi. >> ** ADD ANY OTHER STATISTICS YOU THINK RELEVANT HERE* >> ** Just need an expression to update from TOTAL to Leaving one out*. >> END LOOP. >> * Calculate Min, Max, Mean and SD for JackKnife statistics *. >> . COMPUTE Stats=CMIN(JackStat). >> . COMPUTE Stats={Stats;CMAX(JackStat)}. >> . COMPUTE Stats={Stats;CSUM(JackStat)/n}. >> . COMPUTE Stats={Stats;CSSQ(JackStat)-N*Stats(3,:)&**2}. >> . COMPUTE Stats(4,:)=SQRT(Stats(4,:)/(n-1)). >> >> COMPUTE AllNames={'R2','P2',vnames}. >> COMPUTE ROWID={"Min", "Max", "Mean", "Std Dev"}. >> COMPUTE JackStat={T({1:NROW(JackStat)}),JackStat}. >> PRINT Stats /FORMAT='F8.3' /CNAMES=AllNames /RNAMES=RowID >> /TITLE='Min, Max, Mean, Std Dev of Jackknife statistics'. >> * Report first Nrept values *. >> COMPUTE ClNames={"CaseID",AllNames}. >> PRINT {JackStat(1:!Nrept,:)} /FORMAT='F8.3' /CNAMES=ClNames >> /TITLE=!QUOTE(!CONCAT('Jackknife statistics for rows 1-',!NRept)). >> * Export JK statistics to active dataset *. >> COMPUTE JackStat=JackStat(:,2:NCol(JackStat)). >> SAVE JackStat /OUTFILE='Coefficients.sav' /Variables R2 P2 Constant !X. >> PRINT /TITLE='Jackknife statistics exported to Coefficients Dataset'. >> END MATRIX. >> RESTORE. >> GET FILE 'Coefficients.sav'. >> * This part uses SPSS 14/Newer *. >> ********************************. >> DATASET NAME Coefficients. >> ********************************. >> FORMAT ALL (F8.3). >> VAR LABEL R2 'R Square'/P2 'Adj.R Square'. >> FREQUENCIES VAR=ALL >> /FORMAT=NOTABLE >> /PERCENTILES= 2.5 25 50 75 97.5 >> /STATISTICS=STDDEV MINIMUM MAXIMUM MEAN. >> >> * This part uses SPSS 14/Newer *. >> ********************************. >> DATASET ACTIVATE OriginalData. >> ** Uncomment following line if you wish the JK Coefficients File to remain >> open. >> DATASET CLOSE Coefficients. >> ********************************. >> !ENDDEFINE. >> >> * Sample dataset (50 random cases from Rosner's dataset FEV.sav) *. >> DATA LIST FREE/fev(F8.3) age(F8.0) hgt(F8.1) gender smoke (2 F8.0). >> BEGIN DATA >> 1.415 6 56.0 0 0 2.646 10 60.0 1 0 3.519 19 66.0 0 1 3.000 9 65.5 1 0 >> 3.428 14 64.0 0 1 1.694 11 60.0 1 1 3.957 14 72.0 1 1 1.962 8 57.0 1 0 >> 2.384 12 63.5 0 1 2.679 15 66.0 0 1 2.387 10 66.0 0 1 1.794 8 54.5 1 0 >> 2.646 13 61.5 0 0 2.198 15 62.0 0 1 3.345 19 65.5 0 1 2.599 13 62.5 0 1 >> 3.082 17 67.0 1 1 2.903 16 63.0 0 1 3.004 15 64.0 0 1 1.603 7 51.0 0 0 >> 1.196 5 46.5 0 0 1.697 8 59.0 0 0 2.813 10 61.5 0 0 3.985 15 71.0 1 0 >> 4.309 14 69.0 1 1 1.947 9 56.5 0 0 3.169 11 62.5 0 1 3.406 17 69.0 1 1 >> 2.358 10 59.0 0 0 1.933 9 58.0 0 0 3.297 13 65.0 0 1 3.680 14 67.0 1 0 >> 1.953 9 58.0 1 1 3.247 11 65.5 1 0 4.086 18 67.0 1 1 3.585 14 70.0 1 0 >> 3.498 10 68.0 1 1 2.953 11 67.0 0 1 3.127 10 62.0 1 0 1.338 6 51.5 0 0 >> 2.569 12 63.0 0 0 3.320 11 65.5 1 0 3.780 14 70.0 1 0 4.404 18 70.5 1 1 >> 4.637 11 72.0 1 1 3.727 15 68.0 1 1 4.203 12 71.0 1 0 2.564 7 58.0 0 0 >> 3.152 13 62.0 0 1 2.391 10 59.5 1 0 >> END DATA. >> VAR LABEL fev 'FEV (liters)' /age 'Age (years)' /hgt 'Height (inches)'. >> VALUE LABEL gender 0 'Female' 1 'Male' /smoke 0'Non Smoker' 1'Smoker'. >> VAR LEV gender smoke (NOMINAL). >> >> * Adding an interaction term to the model *. >> COMPUTE smokehgt=smoke*hgt. >> FORMAT smokehgt (F8). >> JKMLRDMM y=fev x=age hgt gender smoke smokehgt / Nrept 40. >> >> >> >> -- >> View this message in context: >> http://spssx-discussion.1045642.n5.nabble.com/JackKnife-for-Multiple-Linear-Regression-tp5522345p5522345.html >> Sent from the SPSSX Discussion mailing list archive at Nabble.com. >> >> ===================== >> To manage your subscription to SPSSX-L, send a message to >> [hidden email] (not to SPSSX-L), with no body text except the >> command. To leave the list, send the command >> SIGNOFF SPSSX-L >> For a list of commands to manage subscriptions, send the command >> INFO REFCARD >> > > ===================== > To manage your subscription to SPSSX-L, send a message to > [hidden email] (not to SPSSX-L), with no body text except the > command. To leave the list, send the command > SIGNOFF SPSSX-L > For a list of commands to manage subscriptions, send the command > INFO REFCARD > > > ________________________________ > If you reply to this email, your message will be added to the discussion > below: > http://spssx-discussion.1045642.n5.nabble.com/JackKnife-for-Multiple-Linear-Regression-tp5522345p5522462.html > To unsubscribe from JackKnife for Multiple Linear Regression, click here. > NAML View this message in context: Re: JackKnife for Multiple Linear Regression Sent from the SPSSX Discussion mailing list archive at Nabble.com.
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me. --- "Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis." Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?" |
El 28/02/2012 18:22, David Marso escribió:
> Hi Marta, > How is Stata? Seems SPSS/IBM licensing policies are going to > eventually compel many others to make the transition. I myself am > still using my old reliable SPSS 11.5 from 2003 (free as part of my > severance from $P$$ inc.). It would cost my several K to upgrade to > the current system and unless I win the lottery, that isn't going to > happen. Stata is remarkably cheaper, lighter (it consumes less resources in terms of hard drive space&memory), but I find it requires a lot of extra work. For instance, this is very simple dataset for a ONEWAY ANCOVA: DATA LIST LIST/Group(A1) Covariate(F8) Depvar(F8). BEGIN DATA A 9 14 A 7 13 A 13 17 A 25 30 B 19 36 B 15 17 B 14 18 B 18 22 C 16 7 C 18 9 C 25 22 C 20 16 D 18 19 D 24 33 D 16 25 D 21 37 E 15 8 E 17 10 E 18 14 E 17 14 F 17 12 F 16 11 F 18 13 F 20 17 END DATA. UNIANOVA Depvar BY Group WITH Covariate /EMMEANS = TABLES(Group) WITH(Covariate=MEAN) COMPARE ADJ(SIDAK) /PRINT = DESCRIPTIVE HOMOGENEITY /PLOT = RESIDUALS /DESIGN = Covariate Group . I still haen't found away to get the same results with Stata. A lot of sequential commands must be executed one by one, predicted and residual values have to be computed by hand, and, for the life of me, I still haven't found how to get the adjusted means and perform pairwise comparisons with Sidak adjustment. I feel too old to learn a new language from scratch, let alone teach it to my students with a certain level of self confidence! But it has to be done. Regards, Marta ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD |
Administrator
|
Marta, have you looked at the "textbook examples" on the UCLA website? You might find some good hints there.
http://www.ats.ucla.edu/stat/stata/examples/da/dastata14.htm http://www.ats.ucla.edu/stat/stata/examples/da/dastata14reg.htm http://www.ats.ucla.edu/stat/stata/examples/kirk/kirkstata15.htm And here's a Stata mailing list post that might help: http://www.stata.com/statalist/archive/2006-09/msg00673.html Cheers! Bruce p.s. - I had been thinking about learning R when I'm retired and no longer have access to a cheap copy of SPSS. (Retirement is still several years off, but no harm in planning ahead.) Based on what you've said, maybe I need to revise that plan! ;-)
--
Bruce Weaver bweaver@lakeheadu.ca http://sites.google.com/a/lakeheadu.ca/bweaver/ "When all else fails, RTFM." PLEASE NOTE THE FOLLOWING: 1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above. 2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/). |
Bruce,
Keep in mind STATA is cheap NOW, but R is open source. The reason I learned SPSS was b/c SAS was too expensive for my workplace. Now SPSS is even more expensive than SAS! Your old plan of learning R still looks good to me.
vlp
On Tue, Feb 28, 2012 at 11:21 AM, Bruce Weaver <[hidden email]> wrote: Marta, have you looked at the "textbook examples" on the UCLA website? You |
In reply to this post by Bruce Weaver
Thanks for the hints, Bruce
Bet regards, Marta El 28/02/2012 20:21, Bruce Weaver escribió: > Marta, have you looked at the "textbook examples" on the UCLA website? You > might find some good hints there. > > http://www.ats.ucla.edu/stat/stata/examples/da/dastata14.htm > http://www.ats.ucla.edu/stat/stata/examples/da/dastata14reg.htm > http://www.ats.ucla.edu/stat/stata/examples/kirk/kirkstata15.htm > > And here's a Stata mailing list post that might help: > > http://www.stata.com/statalist/archive/2006-09/msg00673.html > > Cheers! > Bruce > > p.s. - I had been thinking about learning R when I'm retired and no longer > have access to a cheap copy of SPSS. (Retirement is still several years > off, but no harm in planning ahead.) Based on what you've said, maybe I > need to revise that plan! ;-) > > > > Marta García-Granero-2 wrote >> >> Stata is remarkably cheaper, lighter (it consumes less resources in >> terms of hard drive space&memory), but I find it requires a lot of extra >> work. >> >> >> For instance, this is very simple dataset for a ONEWAY ANCOVA: >> >> DATA LIST LIST/Group(A1) Covariate(F8) Depvar(F8). >> BEGIN DATA >> A 9 14 >> A 7 13 >> A 13 17 >> A 25 30 >> B 19 36 >> B 15 17 >> B 14 18 >> B 18 22 >> C 16 7 >> C 18 9 >> C 25 22 >> C 20 16 >> D 18 19 >> D 24 33 >> D 16 25 >> D 21 37 >> E 15 8 >> E 17 10 >> E 18 14 >> E 17 14 >> F 17 12 >> F 16 11 >> F 18 13 >> F 20 17 >> END DATA. >> >> UNIANOVA >> Depvar BY Group WITH Covariate >> /EMMEANS = TABLES(Group) WITH(Covariate=MEAN) COMPARE ADJ(SIDAK) >> /PRINT = DESCRIPTIVE HOMOGENEITY >> /PLOT = RESIDUALS >> /DESIGN = Covariate Group . >> >> I still haen't found away to get the same results with Stata. A lot of >> sequential commands must be executed one by one, predicted and residual >> values have to be computed by hand, and, for the life of me, I still >> haven't found how to get the adjusted means and perform pairwise >> comparisons with Sidak adjustment. >> >> I feel too old to learn a new language from scratch, let alone teach it >> to my students with a certain level of self confidence! >> >> But it has to be done. >> >> Regards, >> Marta >> >> ===================== >> To manage your subscription to SPSSX-L, send a message to >> LISTSERV@.UGA (not to SPSSX-L), with no body text except the >> command. To leave the list, send the command >> SIGNOFF SPSSX-L >> For a list of commands to manage subscriptions, send the command >> INFO REFCARD >> > > ----- > -- > Bruce Weaver > [hidden email] > http://sites.google.com/a/lakeheadu.ca/bweaver/ > > "When all else fails, RTFM." > > NOTE: My Hotmail account is not monitored regularly. > To send me an e-mail, please use the address shown above. > > -- > View this message in context: http://spssx-discussion.1045642.n5.nabble.com/JackKnife-for-Multiple-Linear-Regression-tp5522345p5522941.html > Sent from the SPSSX Discussion mailing list archive at Nabble.com. > > ===================== > To manage your subscription to SPSSX-L, send a message to > [hidden email] (not to SPSSX-L), with no body text except the > command. To leave the list, send the command > SIGNOFF SPSSX-L > For a list of commands to manage subscriptions, send the command > INFO REFCARD > ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD |
Administrator
|
In reply to this post by Vlad Lopez
Hi Vladimir. Actually, I already own a copy of Stata. I bought it for a pretty good price when I was at a university that was part of the Grad Plan -- http://www.stata.com/order/new/edu/gradplan.html.
When I said I might have to revise my plan to learn R, I was referring to Marta's statement about feeling too old to learn a new package and teach it to others with a certain level of self-confidence. If someone as clever as Marta feels that way at her tender age, I can only imagine how I'll feel about learning a new package/program when I'm retirement age. ;-) Cheers! Bruce
--
Bruce Weaver bweaver@lakeheadu.ca http://sites.google.com/a/lakeheadu.ca/bweaver/ "When all else fails, RTFM." PLEASE NOTE THE FOLLOWING: 1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above. 2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/). |
Bruce
There's always PSPP, the free alternative to SPSS from GNU See: http://www.gnu.org/software/pspp/ On the other hand you could always start a new career as a recognised academic author and get IBM/SPSS free (if you don't mind having to change versions every time a new one comes out, so you can't correct your old tutorials) provided you don't use it for personal gain and provide IBM/SPSS with copies of everything. Fine until they pull the rug out! John Email: [hidden email] Website: www.surveyresearch.weebly.com Skype: surveyresearcher1 Phone: (+33) (0) 2.33.45.91.47 PS I've just uploaded a beta version of a new tutorial on mult response (using the 1986 British Social Attitudes survey) which took dozens of hours to write and check. See: http://surveyresearch.weebly.com/uploads/2/9/9/8/2998485/3.3.3.1__analysing_multiple_response_1_-_one_field_per_code.pdf -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Bruce Weaver Sent: 28 February 2012 21:15 To: [hidden email] Subject: Re: SPSS vs Stata (was: Re: JackKnife for Multiple Linear Regression) Hi Vladimir. Actually, I already own a copy of Stata. I bought it for a pretty good price when I was at a university that was part of the Grad Plan -- http://www.stata.com/order/new/edu/gradplan.html. When I said I might have to revise my plan to learn R, I was referring to Marta's statement about feeling too old to learn a new package and teach it to others with a certain level of self-confidence. If someone as clever as Marta feels that way at her tender age, I can only imagine how I'll feel about learning a new package/program when I'm retirement age. ;-) Cheers! Bruce Vladimir Lopez-Prado wrote > > Bruce, > Keep in mind STATA is cheap NOW, but R is open source. The reason I > learned SPSS was b/c SAS was too expensive for my workplace. Now SPSS > is even more expensive than SAS! Your old plan of learning R still > looks good to me. > > vlp > > On Tue, Feb 28, 2012 at 11:21 AM, Bruce Weaver <bruce.weaver@>wrote: > >> Marta, have you looked at the "textbook examples" on the UCLA website? >> You >> might find some good hints there. >> >> http://www.ats.ucla.edu/stat/stata/examples/da/dastata14.htm >> http://www.ats.ucla.edu/stat/stata/examples/da/dastata14reg.htm >> http://www.ats.ucla.edu/stat/stata/examples/kirk/kirkstata15.htm >> >> And here's a Stata mailing list post that might help: >> >> http://www.stata.com/statalist/archive/2006-09/msg00673.html >> >> Cheers! >> Bruce >> >> p.s. - I had been thinking about learning R when I'm retired and no >> longer have access to a cheap copy of SPSS. (Retirement is still >> several years off, but no harm in planning ahead.) Based on what >> you've said, maybe I need to revise that plan! ;-) >> >> >> >> Marta García-Granero-2 wrote >> > >> > >> > Stata is remarkably cheaper, lighter (it consumes less resources in >> > terms of hard drive space&memory), but I find it requires a lot of >> extra >> > work. >> > >> > >> > For instance, this is very simple dataset for a ONEWAY ANCOVA: >> > >> > DATA LIST LIST/Group(A1) Covariate(F8) Depvar(F8). >> > BEGIN DATA >> > A 9 14 >> > A 7 13 >> > A 13 17 >> > A 25 30 >> > B 19 36 >> > B 15 17 >> > B 14 18 >> > B 18 22 >> > C 16 7 >> > C 18 9 >> > C 25 22 >> > C 20 16 >> > D 18 19 >> > D 24 33 >> > D 16 25 >> > D 21 37 >> > E 15 8 >> > E 17 10 >> > E 18 14 >> > E 17 14 >> > F 17 12 >> > F 16 11 >> > F 18 13 >> > F 20 17 >> > END DATA. >> > >> > UNIANOVA >> > Depvar BY Group WITH Covariate >> > /EMMEANS = TABLES(Group) WITH(Covariate=MEAN) COMPARE ADJ(SIDAK) >> > /PRINT = DESCRIPTIVE HOMOGENEITY >> > /PLOT = RESIDUALS >> > /DESIGN = Covariate Group . >> > >> > I still haen't found away to get the same results with Stata. A lot >> > of sequential commands must be executed one by one, predicted and >> > residual values have to be computed by hand, and, for the life of >> > me, I still haven't found how to get the adjusted means and perform >> > pairwise comparisons with Sidak adjustment. >> > >> > I feel too old to learn a new language from scratch, let alone >> > teach it to my students with a certain level of self confidence! >> > >> > But it has to be done. >> > >> > Regards, >> > Marta >> > >> > ===================== >> > To manage your subscription to SPSSX-L, send a message to >> > LISTSERV@.UGA (not to SPSSX-L), with no body text except the >> > command. To leave the list, send the command SIGNOFF SPSSX-L For a >> > list of commands to manage subscriptions, send the command INFO >> > REFCARD >> > >> >> >> ----- >> -- >> Bruce Weaver >> bweaver@ >> http://sites.google.com/a/lakeheadu.ca/bweaver/ >> >> "When all else fails, RTFM." >> >> NOTE: My Hotmail account is not monitored regularly. >> To send me an e-mail, please use the address shown above. >> >> -- >> View this message in context: >> http://spssx-discussion.1045642.n5.nabble.com/JackKnife-for-Multiple- >> Linear-Regression-tp5522345p5522941.html >> Sent from the SPSSX Discussion mailing list archive at Nabble.com. >> >> ===================== >> To manage your subscription to SPSSX-L, send a message to >> LISTSERV@.UGA (not to SPSSX-L), with no body text except the command. >> To leave the list, send the command SIGNOFF SPSSX-L For a list of >> commands to manage subscriptions, send the command INFO REFCARD >> > ----- -- Bruce Weaver [hidden email] http://sites.google.com/a/lakeheadu.ca/bweaver/ "When all else fails, RTFM." NOTE: My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above. -- View this message in context: http://spssx-discussion.1045642.n5.nabble.com/JackKnife-for-Multiple-Linear-Regression-tp5522345p5523105.html Sent from the SPSSX Discussion mailing list archive at Nabble.com. ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD |
I use both products SPSS and Stata. I believe you can't compare these
products as their strengths are different. SPSS is great for doing initial analysis and all data manipulation tasks. Stata is great for doing complicated modelling tasks such as panel modelling. They kind of complement each other. Regards, San On 2/29/12, John F Hall <[hidden email]> wrote: > Bruce > > There's always PSPP, the free alternative to SPSS from GNU > See: http://www.gnu.org/software/pspp/ > > On the other hand you could always start a new career as a recognised > academic author and get IBM/SPSS free (if you don't mind having to change > versions every time a new one comes out, so you can't correct your old > tutorials) provided you don't use it for personal gain and provide IBM/SPSS > with copies of everything. Fine until they pull the rug out! > > John > > Email: [hidden email] > Website: www.surveyresearch.weebly.com > Skype: surveyresearcher1 > Phone: (+33) (0) 2.33.45.91.47 > > PS I've just uploaded a beta version of a new tutorial on mult response > (using the 1986 British Social Attitudes survey) which took dozens of hours > to write and check. See: > http://surveyresearch.weebly.com/uploads/2/9/9/8/2998485/3.3.3.1__analysing_multiple_response_1_-_one_field_per_code.pdf > > > > > > > > -----Original Message----- > From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of > Bruce Weaver > Sent: 28 February 2012 21:15 > To: [hidden email] > Subject: Re: SPSS vs Stata (was: Re: JackKnife for Multiple Linear > Regression) > > Hi Vladimir. Actually, I already own a copy of Stata. I bought it for a > pretty good price when I was at a university that was part of the Grad Plan > -- http://www.stata.com/order/new/edu/gradplan.html. > > When I said I might have to revise my plan to learn R, I was referring to > Marta's statement about feeling too old to learn a new package and teach it > to others with a certain level of self-confidence. If someone as clever as > Marta feels that way at her tender age, I can only imagine how I'll feel > about learning a new package/program when I'm retirement age. ;-) > > Cheers! > Bruce > > > > Vladimir Lopez-Prado wrote >> >> Bruce, >> Keep in mind STATA is cheap NOW, but R is open source. The reason I >> learned SPSS was b/c SAS was too expensive for my workplace. Now SPSS >> is even more expensive than SAS! Your old plan of learning R still >> looks good to me. >> >> vlp >> >> On Tue, Feb 28, 2012 at 11:21 AM, Bruce Weaver <bruce.weaver@>wrote: >> >>> Marta, have you looked at the "textbook examples" on the UCLA website? >>> You >>> might find some good hints there. >>> >>> http://www.ats.ucla.edu/stat/stata/examples/da/dastata14.htm >>> http://www.ats.ucla.edu/stat/stata/examples/da/dastata14reg.htm >>> http://www.ats.ucla.edu/stat/stata/examples/kirk/kirkstata15.htm >>> >>> And here's a Stata mailing list post that might help: >>> >>> http://www.stata.com/statalist/archive/2006-09/msg00673.html >>> >>> Cheers! >>> Bruce >>> >>> p.s. - I had been thinking about learning R when I'm retired and no >>> longer have access to a cheap copy of SPSS. (Retirement is still >>> several years off, but no harm in planning ahead.) Based on what >>> you've said, maybe I need to revise that plan! ;-) >>> >>> >>> >>> Marta García-Granero-2 wrote >>> > >>> > >>> > Stata is remarkably cheaper, lighter (it consumes less resources in >>> > terms of hard drive space&memory), but I find it requires a lot of >>> extra >>> > work. >>> > >>> > >>> > For instance, this is very simple dataset for a ONEWAY ANCOVA: >>> > >>> > DATA LIST LIST/Group(A1) Covariate(F8) Depvar(F8). >>> > BEGIN DATA >>> > A 9 14 >>> > A 7 13 >>> > A 13 17 >>> > A 25 30 >>> > B 19 36 >>> > B 15 17 >>> > B 14 18 >>> > B 18 22 >>> > C 16 7 >>> > C 18 9 >>> > C 25 22 >>> > C 20 16 >>> > D 18 19 >>> > D 24 33 >>> > D 16 25 >>> > D 21 37 >>> > E 15 8 >>> > E 17 10 >>> > E 18 14 >>> > E 17 14 >>> > F 17 12 >>> > F 16 11 >>> > F 18 13 >>> > F 20 17 >>> > END DATA. >>> > >>> > UNIANOVA >>> > Depvar BY Group WITH Covariate >>> > /EMMEANS = TABLES(Group) WITH(Covariate=MEAN) COMPARE ADJ(SIDAK) >>> > /PRINT = DESCRIPTIVE HOMOGENEITY >>> > /PLOT = RESIDUALS >>> > /DESIGN = Covariate Group . >>> > >>> > I still haen't found away to get the same results with Stata. A lot >>> > of sequential commands must be executed one by one, predicted and >>> > residual values have to be computed by hand, and, for the life of >>> > me, I still haven't found how to get the adjusted means and perform >>> > pairwise comparisons with Sidak adjustment. >>> > >>> > I feel too old to learn a new language from scratch, let alone >>> > teach it to my students with a certain level of self confidence! >>> > >>> > But it has to be done. >>> > >>> > Regards, >>> > Marta >>> > >>> > ===================== >>> > To manage your subscription to SPSSX-L, send a message to >>> > LISTSERV@.UGA (not to SPSSX-L), with no body text except the >>> > command. To leave the list, send the command SIGNOFF SPSSX-L For a >>> > list of commands to manage subscriptions, send the command INFO >>> > REFCARD >>> > >>> >>> >>> ----- >>> -- >>> Bruce Weaver >>> bweaver@ >>> http://sites.google.com/a/lakeheadu.ca/bweaver/ >>> >>> "When all else fails, RTFM." >>> >>> NOTE: My Hotmail account is not monitored regularly. >>> To send me an e-mail, please use the address shown above. >>> >>> -- >>> View this message in context: >>> http://spssx-discussion.1045642.n5.nabble.com/JackKnife-for-Multiple- >>> Linear-Regression-tp5522345p5522941.html >>> Sent from the SPSSX Discussion mailing list archive at Nabble.com. >>> >>> ===================== >>> To manage your subscription to SPSSX-L, send a message to >>> LISTSERV@.UGA (not to SPSSX-L), with no body text except the command. >>> To leave the list, send the command SIGNOFF SPSSX-L For a list of >>> commands to manage subscriptions, send the command INFO REFCARD >>> >> > > > ----- > -- > Bruce Weaver > [hidden email] > http://sites.google.com/a/lakeheadu.ca/bweaver/ > > "When all else fails, RTFM." > > NOTE: My Hotmail account is not monitored regularly. > To send me an e-mail, please use the address shown above. > > -- > View this message in context: > http://spssx-discussion.1045642.n5.nabble.com/JackKnife-for-Multiple-Linear-Regression-tp5522345p5523105.html > Sent from the SPSSX Discussion mailing list archive at Nabble.com. > > ===================== > To manage your subscription to SPSSX-L, send a message to > [hidden email] (not to SPSSX-L), with no body text except the > command. To leave the list, send the command SIGNOFF SPSSX-L For a list of > commands to manage subscriptions, send the command INFO REFCARD > > ===================== > To manage your subscription to SPSSX-L, send a message to > [hidden email] (not to SPSSX-L), with no body text except the > command. To leave the list, send the command > SIGNOFF SPSSX-L > For a list of commands to manage subscriptions, send the command > INFO REFCARD > ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD |
Absolutely! A lot of UK academic centres running courses in survey analysis
are switching to Stata A for financial reasons (and probably because a lot of the tutors are more into sampling theory and statistical modelling than understanding what respondents are actually saying to them). SPSS is perfectly adequate for my purposes. IBM/SPSS should consider an even cheaper special version/price for academic centres to keep it affordable. After all, mastery of SPSS will always help to get you a job, but will Stata? John Hall Email: [hidden email] Website: www.surveyresearch.weebly.com Skype: surveyresearcher1 Phone: (+33) (0) 2.33.45.91.47 -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of San K Sent: 29 February 2012 02:37 To: [hidden email] Subject: Re: SPSS vs Stata (was: Re: JackKnife for Multiple Linear Regression) I use both products SPSS and Stata. I believe you can't compare these products as their strengths are different. SPSS is great for doing initial analysis and all data manipulation tasks. Stata is great for doing complicated modelling tasks such as panel modelling. They kind of complement each other. Regards, San On 2/29/12, John F Hall <[hidden email]> wrote: > Bruce > > There's always PSPP, the free alternative to SPSS from GNU > See: http://www.gnu.org/software/pspp/ > > On the other hand you could always start a new career as a recognised > academic author and get IBM/SPSS free (if you don't mind having to > change versions every time a new one comes out, so you can't correct > your old > tutorials) provided you don't use it for personal gain and provide > IBM/SPSS with copies of everything. Fine until they pull the rug out! > > John > > Email: [hidden email] > Website: www.surveyresearch.weebly.com > Skype: surveyresearcher1 > Phone: (+33) (0) 2.33.45.91.47 > > PS I've just uploaded a beta version of a new tutorial on mult > response (using the 1986 British Social Attitudes survey) which took > dozens of hours to write and check. See: > http://surveyresearch.weebly.com/uploads/2/9/9/8/2998485/3.3.3.1__anal > ysing_multiple_response_1_-_one_field_per_code.pdf > > > > > > > > -----Original Message----- > From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf > Of Bruce Weaver > Sent: 28 February 2012 21:15 > To: [hidden email] > Subject: Re: SPSS vs Stata (was: Re: JackKnife for Multiple Linear > Regression) > > Hi Vladimir. Actually, I already own a copy of Stata. I bought it > for a pretty good price when I was at a university that was part of > the Grad Plan > -- http://www.stata.com/order/new/edu/gradplan.html. > > When I said I might have to revise my plan to learn R, I was referring > to Marta's statement about feeling too old to learn a new package and > teach it to others with a certain level of self-confidence. If > someone as clever as Marta feels that way at her tender age, I can only > about learning a new package/program when I'm retirement age. ;-) > > Cheers! > Bruce > > > > Vladimir Lopez-Prado wrote >> >> Bruce, >> Keep in mind STATA is cheap NOW, but R is open source. The reason I >> learned SPSS was b/c SAS was too expensive for my workplace. Now SPSS >> is even more expensive than SAS! Your old plan of learning R still >> looks good to me. >> >> vlp >> >> On Tue, Feb 28, 2012 at 11:21 AM, Bruce Weaver >> >>> Marta, have you looked at the "textbook examples" on the UCLA website? >>> You >>> might find some good hints there. >>> >>> http://www.ats.ucla.edu/stat/stata/examples/da/dastata14.htm >>> http://www.ats.ucla.edu/stat/stata/examples/da/dastata14reg.htm >>> http://www.ats.ucla.edu/stat/stata/examples/kirk/kirkstata15.htm >>> >>> And here's a Stata mailing list post that might help: >>> >>> http://www.stata.com/statalist/archive/2006-09/msg00673.html >>> >>> Cheers! >>> Bruce >>> >>> p.s. - I had been thinking about learning R when I'm retired and no >>> longer have access to a cheap copy of SPSS. (Retirement is still >>> several years off, but no harm in planning ahead.) Based on what >>> you've said, maybe I need to revise that plan! ;-) >>> >>> >>> >>> Marta García-Granero-2 wrote >>> > >>> > >>> > Stata is remarkably cheaper, lighter (it consumes less resources >>> > in terms of hard drive space&memory), but I find it requires a lot >>> > of >>> extra >>> > work. >>> > >>> > >>> > For instance, this is very simple dataset for a ONEWAY ANCOVA: >>> > >>> > DATA LIST LIST/Group(A1) Covariate(F8) Depvar(F8). >>> > BEGIN DATA >>> > A 9 14 >>> > A 7 13 >>> > A 13 17 >>> > A 25 30 >>> > B 19 36 >>> > B 15 17 >>> > B 14 18 >>> > B 18 22 >>> > C 16 7 >>> > C 18 9 >>> > C 25 22 >>> > C 20 16 >>> > D 18 19 >>> > D 24 33 >>> > D 16 25 >>> > D 21 37 >>> > E 15 8 >>> > E 17 10 >>> > E 18 14 >>> > E 17 14 >>> > F 17 12 >>> > F 16 11 >>> > F 18 13 >>> > F 20 17 >>> > END DATA. >>> > >>> > UNIANOVA >>> > Depvar BY Group WITH Covariate >>> > /EMMEANS = TABLES(Group) WITH(Covariate=MEAN) COMPARE ADJ(SIDAK) >>> > /PRINT = DESCRIPTIVE HOMOGENEITY >>> > /PLOT = RESIDUALS >>> > /DESIGN = Covariate Group . >>> > >>> > I still haen't found away to get the same results with Stata. A >>> > lot of sequential commands must be executed one by one, predicted >>> > and residual values have to be computed by hand, and, for the life >>> > of me, I still haven't found how to get the adjusted means and >>> > perform pairwise comparisons with Sidak adjustment. >>> > >>> > I feel too old to learn a new language from scratch, let alone >>> > teach it to my students with a certain level of self confidence! >>> > >>> > But it has to be done. >>> > >>> > Regards, >>> > Marta >>> > >>> > ===================== >>> > To manage your subscription to SPSSX-L, send a message to >>> > LISTSERV@.UGA (not to SPSSX-L), with no body text except the >>> > command. To leave the list, send the command SIGNOFF SPSSX-L For a >>> > list of commands to manage subscriptions, send the command INFO >>> > REFCARD >>> > >>> >>> >>> ----- >>> -- >>> Bruce Weaver >>> bweaver@ >>> http://sites.google.com/a/lakeheadu.ca/bweaver/ >>> >>> "When all else fails, RTFM." >>> >>> NOTE: My Hotmail account is not monitored regularly. >>> To send me an e-mail, please use the address shown above. >>> >>> -- >>> View this message in context: >>> http://spssx-discussion.1045642.n5.nabble.com/JackKnife-for-Multiple >>> - Linear-Regression-tp5522345p5522941.html >>> Sent from the SPSSX Discussion mailing list archive at Nabble.com. >>> >>> ===================== >>> To manage your subscription to SPSSX-L, send a message to >>> LISTSERV@.UGA (not to SPSSX-L), with no body text except the command. >>> To leave the list, send the command SIGNOFF SPSSX-L For a list of >>> commands to manage subscriptions, send the command INFO REFCARD >>> >> > > > ----- > -- > Bruce Weaver > [hidden email] > http://sites.google.com/a/lakeheadu.ca/bweaver/ > > "When all else fails, RTFM." > > NOTE: My Hotmail account is not monitored regularly. > To send me an e-mail, please use the address shown above. > > -- > View this message in context: > http://spssx-discussion.1045642.n5.nabble.com/JackKnife-for-Multiple-L > inear-Regression-tp5522345p5523105.html > Sent from the SPSSX Discussion mailing list archive at Nabble.com. > > ===================== > To manage your subscription to SPSSX-L, send a message to > [hidden email] (not to SPSSX-L), with no body text except > the command. To leave the list, send the command SIGNOFF SPSSX-L For a > list of commands to manage subscriptions, send the command INFO > REFCARD > > ===================== > To manage your subscription to SPSSX-L, send a message to > [hidden email] (not to SPSSX-L), with no body text except > the command. To leave the list, send the command SIGNOFF SPSSX-L For a > list of commands to manage subscriptions, send the command INFO > REFCARD > ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD |
El 29/02/2012 10:06, John F Hall escribió:
> Absolutely! A lot of UK academic centres running courses in survey analysis > are switching to Stata A for financial reasons (and probably because a lot > of the tutors are more into sampling theory and statistical modelling than > understanding what respondents are actually saying to them). > > SPSS is perfectly adequate for my purposes. IBM/SPSS should consider an > even cheaper special version/price for academic centres to keep it > affordable. So say we all! I have many times advocated that SPSS 15 should be offered at a special (=low) fee for academic purposes only. If students don't learn SPSS, they will never use it as graduates. The fancy advances of the newer versions (Python, R-plug in, programmability...) are not really needed at that step, they are a plus they would learn afterwards. You don't need Ferrari to learn how to drive, a cheaper car will do. Many researchers (at least at the University Clinic I work to) are happy with macros (usually my macros) and don't want to look beyond. "This does everything I need, why change?" is their motto. I really wish my University did not abandon SPSS completely, but these are not the best times for big expenses... Best regards "Tender age" ;) Marta (as a matter of fact, rather close to 50, Bruce) ===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD |
Free forum by Nabble | Edit this page |