|
I was wondering how to go about conducting logistic regression with
bootstrapping. I have seen the syntax for OLS using OMS and a macro but can't seem to adjust it to work for logistic regression. Any suggestions? Thanks ===================== 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 |
|
Christopher,
I have attached a syntax file that I have successfully used for generating bootrapped logistic regression coefficients. You should be able to use this as a model for your problem. Good luck. Michael Kruger ***oms_bootstrapping.sps***. PRESERVE. SET TVARS NAMES. ***first OMS command just suppresses Viewer output***. OMS /DESTINATION VIEWER=YES. DATASET DECLARE bootstrap_example. ***select regression coefficients tables and write to data file***. ***Note that DIMNAMES values vary based on output language***. ***/COLUMNS SEQUENCE=[R2 C1] will achieve the same result in all languages***. OMS /SELECT TABLES /IF COMMANDS=['Logistic Regression'] SUBTYPES = ['Variables in the Equation'] /DESTINATION FORMAT=SAV OUTFILE='bootstrap_example' /COLUMNS DIMNAMES=['Variables' 'Statistics'] /TAG='logeg_coeff'. ***define a macro to draw samples with replacement and run Regression commands***. DEFINE regression_bootstrap (samples=!TOKENS(1) /depvar=!TOKENS(1) /indvars=!CMDEND) COMPUTE dummyvar=1. AGGREGATE /OUTFILE = * MODE = ADDVARIABLES /BREAK=dummyvar /filesize=N. !DO !other=1 !TO !samples SET SEED RANDOM. WEIGHT OFF. FILTER OFF. DO IF $casenum=1. - COMPUTE #samplesize=filesize. - COMPUTE #filesize=filesize. END IF. DO IF (#samplesize>0 and #filesize>0). - COMPUTE sampleWeight=rv.binom(#samplesize, 1/#filesize). - COMPUTE #samplesize=#samplesize-sampleWeight. - COMPUTE #filesize=#filesize-1. ELSE. - COMPUTE sampleWeight=0. END IF. WEIGHT BY sampleWeight. FILTER BY sampleWeight. LOGISTIC REGRESSION VARIABLES survival /METHOD = FSTEP(LR) Race_Cat Best_GA Steroid AC PPROM FL_Cat /CONTRAST (Race_Cat)=Deviation(1) /CONTRAST (Steroid)=Indicator(1) /CONTRAST (PPROM)=Indicator(1) /CONTRAST (FL_Cat)=Indicator(1) /PRINT = CI(95) /CRITERIA = PIN(.05) POUT(.10) ITERATE(20) CUT(.5) . !DOEND !ENDDEFINE. ***insert any valid path\data file name***. GET FILE='e:\miscellaneous\ms_rbs_data2.sav'. ***Call the macro, and specify number of samples, dependent variable, and independent variables***. regression_bootstrap samples=10 OMSEND. DATASET ACTIVATE bootstrap_example. RESTORE. |
|
Hi all.....Along the lines of Michael's syntax, I have tested a multiple regression model (k = 3 predictors) for n = 111.....at this juncture the PI is interested in testing the same model for a select strata of n = 17.......despite the small sample, I did run the model but was thinking that bootstrapping might be an option here...I am a neophyte to this technique (though I've done some in PRELIS/LISREL in a SEM context), and upon search found some syntax from Dave Nichols for bootstrapping in regression and as well an example of using the nonlinear regression option (after specifying the parameter estimates).................that being said, for those of you versed in bootstrapping, would doing such a technique for n = 17 raise some eyebrows?....I believe I read somewhere that bootstrapping does not mitigate the fact one still has a small sample to start (and the attendant bias)...................so I would be most appreciative to solicit your
opinions.... thank you...dale glasesr Dale Glaser, Ph.D. Principal--Glaser Consulting Lecturer/Adjunct Faculty--SDSU/USD/AIU President, San Diego Chapter of American Statistical Association 3115 4th Avenue San Diego, CA 92103 phone: 619-220-0602 fax: 619-220-0412 email: [hidden email] website: www.glaserconsult.com --- On Wed, 11/12/08, Michael Kruger <[hidden email]> wrote: From: Michael Kruger <[hidden email]> Subject: Re: Bootstrapping To: [hidden email] Date: Wednesday, November 12, 2008, 10:54 AM Christopher, I have attached a syntax file that I have successfully used for generating bootrapped logistic regression coefficients. You should be able to use this as a model for your problem. Good luck. Michael Kruger ***oms_bootstrapping.sps ====================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 |
|
See if you can get the PI to articulate what kind of difference is
anticipated and if other are other subgroups to control for. Boot strapping would be used to get an error estimate but the small n in that kind of analysis would have large bounds. Depending what the underlying interest is there are some alternatives. 1) do boxplots on that group vs other relevant group(s) on predicted and residual variables. 2) add (a) dummy variable(s) to represent group(s). That will tell you whether the intercept is different. 3) #2 and center the IVs and create interaction terms with the IVs. This will tell whether the slopes are different. If all of the other cases are really the only other group then 1 dummy would do it. Also at that time some interaction terms would not chew up a lot of df. If there are other groups, but the interest is focused on one put in the dummies and then interaction terms for the one group * IVs but not he other groups * IVs. If you have 4 groups apples, oranges, bananas, and blueberries, then a single dummy apple vs other would be a poor representation. Art Kendall Social Research Consultants Dale Glaser wrote: > Hi all.....Along the lines of Michael's syntax, I have tested a multiple regression model (k = 3 predictors) for n = 111.....at this juncture the PI is interested in testing the same model for a select strata of n = 17.......despite the small sample, I did run the model but was thinking that bootstrapping might be an option here...I am a neophyte to this technique (though I've done some in PRELIS/LISREL in a SEM context), and upon search found some syntax from Dave Nichols for bootstrapping in regression and as well an example of using the nonlinear regression option (after specifying the parameter estimates).................that being said, for those of you versed in bootstrapping, would doing such a technique for n = 17 raise some eyebrows?....I believe I read somewhere that bootstrapping does not mitigate the fact one still has a small sample to start (and the attendant bias)...................so I would be most appreciative to solicit your > opinions.... > > thank you...dale glasesr > > Dale Glaser, Ph.D. > Principal--Glaser Consulting > Lecturer/Adjunct Faculty--SDSU/USD/AIU > President, San Diego Chapter of > American Statistical Association > 3115 4th Avenue > San Diego, CA 92103 > phone: 619-220-0602 > fax: 619-220-0412 > email: [hidden email] > website: www.glaserconsult.com > > --- On Wed, 11/12/08, Michael Kruger <[hidden email]> wrote: > > From: Michael Kruger <[hidden email]> > Subject: Re: Bootstrapping > To: [hidden email] > Date: Wednesday, November 12, 2008, 10:54 AM > > Christopher, > > > I have attached a syntax file that I have successfully used for > generating bootrapped logistic regression coefficients. You should be > able to use this as a model for your problem. Good luck. > > Michael Kruger > ***oms_bootstrapping.sps > > =================== > 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
Art Kendall
Social Research Consultants |
|
In reply to this post by Dale Glaser
I really enjoyed your session at JSM. Some of it sounded a lot like my
career. Are you planning to come to DC for the next JSM? Art ===================== 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
Art Kendall
Social Research Consultants |
|
Oops! this reply was only meant to be sent to the OP.
Art Art Kendall wrote: > I really enjoyed your session at JSM. Some of it sounded a lot like my > career. Are you planning to come to DC for the next JSM? > > Art > > ===================== > 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
Art Kendall
Social Research Consultants |
| Free forum by Nabble | Edit this page |
