Login  Register

Re: Percent Change Crosstabs

Posted by Bruce Weaver on May 29, 2013; 6:32pm
URL: http://spssx-discussion.165.s1.nabble.com/Percent-Change-Crosstabs-tp5720440p5720467.html

I too thought that the OP was interested in having confidence intervals -- and I agree with Ryan's final paragraph below.  If one is limited to the 2x2 situation, then CROSSTABS will give the RR and its confidence interval.  And whatever transformation one applies to the RR to change the way of expressing the results can also be applied to the limits of the CI.  

If one wishes to go beyond the 2x2 case, then GENLIN can be used as in the syntax pasted below.

HTH.


* =============================================================
*  File:   RR via GENLIN with log-link.SPS .
*  Date:   17-Feb-2010 .
*  Author:  Bruce Weaver, bweaver@lakeheadu.ca .
* ============================================================= .

* This file shows how to obtain the Risk Ratio (aka Relative Risk)
* by using a Generalized Linear Model with a binary outcome
* variable, a log link function, and a binomial error distribution.

* ---------------------------------------------------------------- .

new file.
dataset close all.

GET FILE='C:\Program Files\SPSSInc\PASWStatistics17\Samples\bankloan.sav'.

freq ed default.
select if nmiss(ed, default) EQ 0.
exe.

recode ed
 (1 2 = 1)
 (3 4 5 = 2) into ed2.
recode default (0=2) (else=copy) into default2.

var lab
 default2 "Defaulted on loan"
 ed2 "Education level"
.
val lab
 ed2 1 "High school or less"
     2 "Some post-secondary" /
 default2 1 "Yes" 2 "No"
.
crosstabs ed by ed2 / default by default2.

crosstabs ed2 by default2 / stat = risk.

* Generalized Linear Model with a logit link function & binomial error.
* This should give the same odds ratio as above.

GENLIN default2 (REFERENCE=LAST) BY ed2 (ORDER=ASCENDING)
  /MODEL ed2 INTERCEPT=YES
 DISTRIBUTION=BINOMIAL LINK=LOGIT
  /CRITERIA METHOD=FISHER(1) SCALE=1 COVB=MODEL
    MAXITERATIONS=100 MAXSTEPHALVING=5
    PCONVERGE=1E-006(ABSOLUTE) SINGULAR=1E-012
    ANALYSISTYPE=3(LR) CILEVEL=95 CITYPE=WALD LIKELIHOOD=FULL    
  /MISSING CLASSMISSING=EXCLUDE
  /PRINT CPS DESCRIPTIVES MODELINFO FIT SUMMARY SOLUTION (EXPONENTIATED).

* As expected, this model does give me the same OR as above.

* Generalized Linear Model with log-link & binomial error .
* This should give me the 1st relative risk shown above (.699) .

GENLIN default2 (REFERENCE=LAST) BY ed2 (ORDER=ASCENDING)
  /MODEL ed2 INTERCEPT=YES
 DISTRIBUTION=BINOMIAL LINK=LOG
  /CRITERIA METHOD=FISHER(1) SCALE=1 COVB=MODEL
    MAXITERATIONS=100 MAXSTEPHALVING=5
    PCONVERGE=1E-006(ABSOLUTE) SINGULAR=1E-012
    ANALYSISTYPE=3(WALD) CILEVEL=95 CITYPE=WALD
    LIKELIHOOD=FULL
  /MISSING CLASSMISSING=EXCLUDE
  /PRINT CPS DESCRIPTIVES MODELINFO FIT SUMMARY SOLUTION (EXPONENTIATED).

* To get the second RR shown above (1.159), I think I need
* to make set the referent to the FIRST category of DEFAULT2.

GENLIN default2 (REFERENCE=FIRST) BY ed2 (ORDER=ASCENDING)
  /MODEL ed2 INTERCEPT=YES
 DISTRIBUTION=BINOMIAL LINK=LOG
  /CRITERIA METHOD=FISHER(1) SCALE=1 COVB=MODEL
    MAXITERATIONS=100 MAXSTEPHALVING=5
    PCONVERGE=1E-006(ABSOLUTE) SINGULAR=1E-012
    ANALYSISTYPE=3(WALD) CILEVEL=95 CITYPE=WALD
    LIKELIHOOD=FULL
  /MISSING CLASSMISSING=EXCLUDE
  /PRINT CPS DESCRIPTIVES MODELINFO FIT SUMMARY SOLUTION (EXPONENTIATED).

* Yes, that's done it.

crosstabs ed2 by default2 / stat = risk.

* In another file, I'll see if I can model the Risk Difference
* by using GENLIN with an Identity link function and a
* binomial error .

* ============================================================= .



Ryan Black wrote
John,

You certainly can. I thought the OP was interested in statistical
testing/confidence intervals.

With that said, one can use the approach outlined by Bruce or myself to
test if the absolute difference is significantly different from zero.

However, if one is interested in a statistical test regarding percent
change in risk, then I would argue that it would be more appropriate
to test whether the relative risk (RR) is significantly different from 1.0.
With the model parameterized correctly, one could directly obtain the RR
confidence limits, which could be converted to % change in risk.

Best,

Ryan


On Wed, May 29, 2013 at 12:22 PM, John F Hall <[hidden email]> wrote:

> Forgive a naive question, but with a 2 x 2 table why can’t you simply
> calculate epsilon (% diff) by hand?  This technique is called elaboration,
> See: M Rosenberg,  The Logic of Survey Analysis (Basic Books, 1968)****
>
> ** **
>
> ** **
>
> John F Hall (Mr)****
>
> [Retired academic survey researcher]****
>
> ** **
>
> Email:   [hidden email]  ****
>
> Website: www.surveyresearch.weebly.com ****
>
> SPSS start page:  www.surveyresearch.weebly.com/spss-without-tears.html **
> **
>
>   ****
>
>   ****
>
> ** **
>
> ** **
>
> ** **
>
> ** **
>
> ** **
>
> *From:* SPSSX(r) Discussion [mailto:[hidden email]] *On Behalf
> Of *DKUKEC
> *Sent:* 29 May 2013 14:53
> *To:* [hidden email]
> *Subject:* Re: Percent Change Crosstabs****
>
> ** **
>
> Thank you Ryan & Bruce, Very much appreciate your replies and suggested
> syntax. I am looking for the following computations... for example: %
> Difference in recidivism rate = Treatment Recidivism % - Control Recidivism
> %. % Change in the recidivism = Difference % / Control Recidivism %.
> ***************************************************************************
> 2X2 CROSSTAB EXAMPLE Recidivist Non-Recidivist Total Treatment 816 1133
> 1949 Control 936 1013 1949 Row % Row % Row % Treatment 41.9% 58.1% 100.0%
> Control 48.0% 52.0% 100.0% ****** Would like to compute
> %************************* Difference -6.1% % Change -12.7%
> ***************************************************** Sincerely, Damir ***
> *
> ------------------------------
>
> View this message in context: Re: Percent Change Crosstabs<http://spssx-discussion.1045642.n5.nabble.com/Percent-Change-Crosstabs-tp5720440p5720451.html>
> Sent from the SPSSX Discussion mailing list archive<http://spssx-discussion.1045642.n5.nabble.com/>at Nabble.com.
> ****
>
--
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/).