| To: | s-news@lists.biostat.wustl.edu |
|---|---|
| Subject: | remove var from model object |
| From: | Russell.Ivory@MerrickBank.com |
| Date: | Wed, 17 Sep 2003 12:20:29 -0600 |
|
I have a model testmodel <- lrm(depvar ~ age+fscore+accts+lates+stage) As part of my diagnostics I want to manipulate things one continuous measure at a time. I want to write a function to run a new model that will in short look for linearity. I have the steps of my function down but I'm having trouble manipulating the model arguments in the function call. I'd like to have the aruments be very simple as function(testmodel,indvar) where testmodel is the existing model object and indvar is the variable in question that I will pull out and manipulate. For example, if I were looking at age in the model above, the function call would look like function(testmodel,age) and the model would then become lrm(depvar ~ age +fscore+accts+lates+stage - age + agemanipulated) In other words, I would pull age out of the existing model and plug in a manipulated version of age then re-run the model. I've tried to simply pull age out as a first step with things like modelvars <- depvar ~ age+fscore+accts+lates+stage
or paste("lrm(", substring(testmodel$call, 1, max(nchar(testmodel$call)))[2], "-age)")
but to no avail. I'm sure the solution is simple, but I cannot find it. Any pointers would be greatly appreciated. Russell Ivory
****************************************************************************This e-mail and any files transmitted with it are confidential and are intended solely for the use of the individual or entity to whom it is addressed. If you are not the intended recipient or the person responsible for delivering the e-mail to the intended recipient, be advised that you have received this e-mail in error, and that any use, dissemination, forwarding, printing, or copying of this e-mail is strictly prohibited. If you received this e-mail in error, please return the e-mail to the sender at Merrick Bank and delete it from your computer. Although Merrick Bank attempts to sweep e-mail and attachments for viruses, it does not guarantee that either are virus-free and accepts no liability for any damage sustained as a result of viruses. |
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: inverting a timeDate sequence, Nick.Ellis |
|---|---|
| Next by Date: | Atlantic City Conference on Applied Statistics, fredbalch |
| Previous by Thread: | inverting a timeDate sequence, Paul H. Lasky |
| Next by Thread: | Re: remove var from model object, Frank E Harrell Jr |
| Indexes: | [Date] [Thread] [Top] [All Lists] |