[R] Select some, but not all, variables stepwise

2011-11-04 Thread Andre Easom
Hi, I would like to fit a linear model where some but not all explanators are chosen stepwise - ie I definitely want to include some terms, but others only if they are deemed significant (by AIC or whatever other approach is available). For example if I wanted to definitely include x1 and x2,

[R] Adding a time variable prior to using reshape

2010-10-06 Thread Andre Easom
Hi, I want to use reshape to convert from a skinny to a wide data format. My data doesn't have a time variable attached - I have a series of ordered observations for each subject, and it is this ordering that I am interested in (my objective is to model the most recent observation based on

[R] Using a loop to define new variables

2010-05-28 Thread Andre Easom
Hi, I'm a novice R user, much more used to SAS. My problem is pretty simple - basically, in a data frame, I have variables named x1,,x10 and y1,...,y10; and I would like to create r1 = x1 / y1 etc Apologies if this is way too rudimentary - but I couldn't find any posts online which solve