Hello, How can I run a backward stepwise regression with part of the variables fixed, while the others participate in the backward stepwise analysis? Thank you, Einat -- View this message in context: r.789695.n4.nabble.com/Stepwise-analysis-with-fixed-variables-tp4650015.html Sent from the R help mailing list archive at Nabble.com.
On 19.11.2012 08:49, Einat wrote:> Hello, > How can I run a backward stepwise regression with part of the variables > fixed, while the others participate in the backward stepwise analysis? > Thank you, EinatRead ?step and about its argument "scope" that can be a list with a "lower" component where you specify the minimal model. Uwe Ligges> > > > -- > View this message in context: r.789695.n4.nabble.com/Stepwise-analysis-with-fixed-variables-tp4650015.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at r-project.org mailing list > stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >
Thank you for the quick reply. Two more questions: 1. For example, if this is my code:>RegModel lm(glucose~sex+BMI+height+weight+education+ses,weight=w_without_non_response) >summary(RegModel) >step(RegModel, direction ="backward",scope=list(lower=?,upper=?))and I want the sex and height variables to be fixed, but the rest of the variables to go into the backward analysis, how should I write the scope function? 2.How can I add an alpha level to the step function as a criterion for the backward regression analysis? Thank you very much, Einat -- View this message in context: r.789695.n4.nabble.com/Stepwise-analysis-with-fixed-variables-tp4650015p4650030.html Sent from the R help mailing list archive at Nabble.com.
I am sorry, but I think my questions were forgotten. Can someone please answer them? Thank you :) -- View this message in context: r.789695.n4.nabble.com/Stepwise-analysis-with-fixed-variables-tp4650015p4650264.html Sent from the R help mailing list archive at Nabble.com.
Hi. What questions? I do not see any. Petr> -----Original Message----- > From: r-help-bounces at r-project.org [mailto:r-help-bounces at r- > project.org] On Behalf Of Einat > Sent: Wednesday, November 21, 2012 9:32 AM > To: r-help at r-project.org > Subject: Re: [R] Stepwise analysis with fixed variables > > I am sorry, but I think my questions were forgotten. Can someone please > answer them? > Thank you :) > > > > -- > View this message in context: r.789695.n4.nabble.com/Stepwise- > analysis-with-fixed-variables-tp4650015p4650264.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at r-project.org mailing list > stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide R-project.org/posting- > guide.html > and provide commented, minimal, self-contained, reproducible code.
These are my questions: 1. For example, if this is my code:>RegModel lm(glucose~sex+BMI+height+weight+education+ses,weight=w_without_non_response)>summary(RegModel)>step(RegModel, direction ="backward",scope=list(lower=?,upper=?))and I want the sex and height variables to be fixed, but the rest of the variables to go into the backward analysis, how should I write the scope function? 2.How can I add an alpha level to the step function as a criterion for the backward regression analysis? Thank you :) -- View this message in context: r.789695.n4.nabble.com/Stepwise-analysis-with-fixed-variables-tp4650015p4650280.html Sent from the R help mailing list archive at Nabble.com.
These are my questions: 1. For example, if this is my code:>RegModel lm(glucose~sex+BMI+height+weight+education+ses,weight=w_without_non_response)>summary(RegModel)>step(RegModel, direction ="backward",scope=list(lower=?,upper=?))and I want the sex and height variables to be fixed, but the rest of the variables to go into the backward analysis, how should I write the scope function? 2.How can I add an alpha level to the step function as a criterion for the backward regression analysis? Thank you :) -- View this message in context: r.789695.n4.nabble.com/Stepwise-analysis-with-fixed-variables-tp4650015p4650283.html Sent from the R help mailing list archive at Nabble.com.
Hi I am not at all an expert in step. From the help page I inferred that step(lm1, scope=list(lower=~Catholic)) keeps Catholic in model. So something like step(RegModel, direction ="backward",scope=list(lower=~sex+height)) shall leave those two in a model. AFAIK there is no parameter alpha in a step function. Regards Petr> -----Original Message----- > From: r-help-bounces at r-project.org [mailto:r-help-bounces at r- > project.org] On Behalf Of Einat > Sent: Wednesday, November 21, 2012 1:41 PM > To: r-help at r-project.org > Subject: Re: [R] Stepwise analysis with fixed variables > > These are my questions: > > 1. For example, if this is my code: > > >RegModel > lm(glucose~sex+BMI+height+weight+education+ses,weight=w_without_non_res > ponse) > >summary(RegModel) > >step(RegModel, direction ="backward",scope=list(lower=?,upper=?)) > > and I want the sex and height variables to be fixed, but the rest of > the variables to go into the backward analysis, how should I write the > scope function? > > 2.How can I add an alpha level to the step function as a criterion for > the backward regression analysis? > > Thank you :) > > > > -- > View this message in context: r.789695.n4.nabble.com/Stepwise- > analysis-with-fixed-variables-tp4650015p4650283.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at r-project.org mailing list > stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide R-project.org/posting- > guide.html > and provide commented, minimal, self-contained, reproducible code.
Thanks. -- View this message in context: r.789695.n4.nabble.com/Stepwise-analysis-with-fixed-variables-tp4650015p4650419.html Sent from the R help mailing list archive at Nabble.com.
Hello, How can I run a backward stepwise regression with part of the variables fixed, while the others participate in the backward stepwise analysis? Thank you ----- TO GET MORE DETAILS CLICK HERE -- View this message in context: r.789695.n4.nabble.com/Stepwise-analysis-with-fixed-variables-tp4651636.html Sent from the R help mailing list archive at Nabble.com.