LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (December 2003)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Thu, 11 Dec 2003 12:48:01 +0100
Reply-To:   Asesoría Bioestadística <bioestadistica@eresmas.net>
Sender:   "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From:   Asesoría Bioestadística <bioestadistica@eresmas.net>
Subject:   Re: Calculating the "Relative Standard Error"
Content-Type:   text/plain; charset=iso-8859-1

Hi:

Just some code to calculate RSE for different type of estimates (means, correlations, RR and OR):

* MEANS * * Dataset*. DATA LIST FREE/group(f8.0) glucose(f8.0). BEGIN DATA 1 51 1 56 1 58 1 60 1 62 1 63 1 65 1 68 1 72 1 73 2 60 2 65 2 66 2 68 2 68 2 69 2 73 2 75 2 78 2 80 3 69 3 73 3 74 3 78 3 79 3 79 3 82 3 85 3 87 3 88 4 70 4 75 4 76 4 77 4 79 4 80 4 82 4 86 4 88 4 89 END DATA. VAR LABEL group 'AcType' /glucose 'Glucose levels'. VALUE LABELS group 1 'Control' 2 'Respiratory' 3 'Metabolic' 4'Mixed'.

* Computing RSE *. AGGREGATE /OUTFILE=* /BREAK=group /mean = MEAN(glucose) /sd = SD(glucose) /n=N. COMPUTE rse=100*sd/SQRT(n)/mean. VAR LABEL rse 'Relat. Std. Error. (%)'. EXEC.

* Report *. SUMMARIZE /TABLES=group mean sd n rse /FORMAT=LIST NOCASENUM TOTAL /TITLE='Case Summaries' /MISSING=VARIABLE /CELLS=NONE.

* CORRELATIONS *

* A summary dataset must be constructed *. DATA LIST LIST /n(F8.0) cor(F8.2). BEGIN DATA 131 0.51 129 0.48 155 0.30 121 0.21 111 0.60 119 0.46 112 0.22 145 0.25 END DATA. VAR LABEL cor 'Pearson`s correlation coefficient' /n 'Sample size'.

* Computing RSE *. COMPUTE rse=100*SQRT((1-cor**2)/(n-2))/cor. VAR LABEL rse 'Relat. Std. Error. (%)'. EXEC.

* Report *. SUMMARIZE /TABLES=cor n rse /FORMAT=LIST NOCASENUM TOTAL /TITLE='Case Summaries' /MISSING=VARIABLE /CELLS=NONE.

* RSE from Z transformed data *. COMPUTE zcor=0.5*LN((1+cor)/(1-cor)). COMPUTE #zse=1/SQRT(n-3). COMPUTE zrse=100*#zse/zcor. VAR LABEL zcor 'Z transformed cor.'. VAR LABEL zrse 'Relat. Std. Error. (%)'. EXEC.

* Report *. SUMMARIZE /TABLES=zcor n zrse /FORMAT=LIST NOCASENUM TOTAL /TITLE='Case Summaries' /MISSING=VARIABLE /CELLS=NONE.

* RR *

* Dataset *. DATA LIST LIST /study(A10) ai(F8.0) n1i(F8.0) ci(F8.0) n0i(F8.0). BEGIN DATA Kirkman 14 40 24 40 VanGelder 3 27 8 30 Nashan-A 51 171 73 166 Kahan 57 173 79 173 Lawen 9 59 17 64 Ponticelli 31 168 50 172 Vincenti 28 126 47 134 Nashan-B 39 140 63 133 END DATA. VAR LABEL study 'Trial ID name' /ai 'Events (acute rejections) in treated group' /n1i 'Total N treated group' /ci 'Events (acute rejections) in control group' /n0i 'Total N control group'.

* Computing statistics *. COMPUTE rr=(ai/n1i)/(ci/n0i). COMPUTE invrr=1/rr. COMPUTE selog=SQRT((1/ai)-(1/n1i)+(1/ci)-(1/n0i)). COMPUTE rse=100*selog/ABS(LN(rr)). VAR LABEL rse 'Relat. Std. Error. (%)'. VAR LABEL rr 'Relative Risk'. VAR LABEL invrr 'Inverse Relative Risk (1/RR)'. VAR LABEL selog 'SE log(RR)'.

* Report *. SUMMARIZE /TABLES=rr invrr selog rse /FORMAT=LIST NOCASENUM TOTAL /TITLE='Case Summaries' /MISSING=VARIABLE /CELLS=NONE.

* OR *

* Dataset *. DATA LIST LIST /study(A10) ai(F8.0) n1i(F8.0) ci(F8.0) n0i(F8.0). BEGIN DATA Kirkman 14 40 24 40 VanGelder 3 27 8 30 Nashan-A 51 171 73 166 Kahan 57 173 79 173 Lawen 9 59 17 64 Ponticelli 31 168 50 172 Vincenti 28 126 47 134 Nashan-B 39 140 63 133 END DATA. VAR LABEL study 'Trial ID name' /ai 'Events (acute rejections) in treated group' /n1i 'Total N treated group' /ci 'Events (acute rejections) in control group' /n0i 'Total N control group'.

* Computing statistics *. COMPUTE bi=n1i-ai. COMPUTE di=n0i-ci. COMPUTE orr=(ai*di)/(ci*bi). COMPUTE invorr=1/orr. COMPUTE selog=SQRT((1/ai)+(1/bi)+(1/ci)+(1/di)). COMPUTE rse=100*selog/ABS(LN(orr)). VAR LABEL rse 'Relat. Std. Error. (%)'. VAR LABEL orr 'Odds Ratio'. VAR LABEL invorr 'Inverse Odds Ratio (1/OR)'. VAR LABEL selog 'SE log(OR)'.

* Report *. SUMMARIZE /TABLES=orr invorr selog rse /FORMAT=LIST NOCASENUM TOTAL /TITLE='Case Summaries' /MISSING=VARIABLE /CELLS=NONE.

Regards

Marta García-Granero

"Arthur J. Kendall" ha escrito:

> I know of no place where it is directly calculated. > Using the definition at > http://www.cdc.gov/nchs/datawh/nchsdefs/relativestandarderror.htm > > You would simply divide the standard error of whatever estimate you are > interested in by the estimate itself. If you have only a few, you would > do by hand. Depending on the kind of estimate you are interested in you > might be able to save estimates and their sd's or se' from some > procedures into a new system file. > > Hope this helps. > > Art > Art@DrKendall.org > Social Research Consultants > University Park, MD USA > (301) 864-5570 > > Jason Payne wrote: > > Dear All, > > > > Does anyone know if this is possible to calculate the RSE in SPSS... and if so, where i might find reference to the syntax that will assist me. > > > > Regards > > > > Jason Payne > > AUSTRALIA > > > > ____________________________________ > > Jason Payne > > Violence, Property Crime and Drugs > > Australian Institute of Criminology > > GPO Box 2944 Canberra ACT 2601 > > > > E-mail: jason.payne@aic.gov.au > > Tel +61 2 6260 9283 Fax +61 2 6260 9201 > > > > Visit the AIC homepage www.aic.gov.au > > > > > > -----Original Message----- > > From: Vincent Toh [mailto:vincent04@pacific.net.sg] > > Sent: Thursday, 11 December 2003 12:43 PM > > To: SPSSX-L@LISTSERV.UGA.EDU > > Subject: Re: Manipulation of Pivot Table by Scripting > > > > > > Dear All, > > > > I am re-posting this mail, as I think the previous one that I sent didn't > > turn out well. > > > > I have a scripting question which I hope someone would be able to assist. > > > > I would like to make changes to the values of each row such that: > > > > 1) if n < 3, suppress result by replacing all the values by "s" . > > 2) if n = 3, show only median values, suppress lower and upper quartile > > values by replacing with "s" . > > > > An example is as follows: > > > > The pivot table that I have created is: > > > > CATEGORY n Lower Quartile Median Upper Quartile > > E&E 34 2300 2349 2461 > > T&E 2 2337 3013 3689 > > P&P 3 3690 3740 3790 > > A&A 0 . . > > . > > > > and my required format is as follows: > > > > CATEGORY n Lower Quartile Median Upper Quartile > > E&E 34 2300 2349 > > 2461 > > T&E 2 s s > > s > > P&P 3 s 3740 > > s > > A&A 0 s s > > s > > > > > > > > As I am unable to attach the documents and post it to the list, should > > anyone require, I could also send it to your emails directly. > > > > Would greatly appreciate if anyone could enlighten! > > > > Thanks and Best Regards, > > Vincent Toh > > Singapore > > > > > > ********************************************************************** > > This email and any files transmitted with it are confidential and > > intended solely for the use of the individual or entity to whom they > > are addressed. If you have received this email in error please notify > > the system manager. > > > > This footnote also confirms that this email message has been swept by > > MIMEsweeper for the presence of computer viruses. > > > > www.mimesweeper.com > > ********************************************************************** > >


Back to: Top of message | Previous page | Main SPSSX-L page