Re: [R] lm: mark sample used in estimation

2011-07-12 Thread Anirban Mukherjee
Thanks Peter, Ted! Best, Anirban On Tue, Jul 12, 2011 at 4:54 AM, Ted Harding wrote: > On 11-Jul-11 07:55:44, Anirban Mukherjee wrote: >> Hi all, >> >> I wanted to mark the estimation sample: mark what rows (observations) >> are deleted by lm due to missingness

[R] lm: mark sample used in estimation

2011-07-11 Thread Anirban Mukherjee
Hi all, I wanted to mark the estimation sample: mark what rows (observations) are deleted by lm due to missingness. For eg, from the original example in help, I have changed one of the values in trt to be NA (missing). # code below # # original example > ctl <- c(4.17,5.58,5.18,6.11,4.50,4.6

Re: [R] predict.lm with new regressor names

2010-12-16 Thread Anirban Mukherjee
ly hard time feeding predict.lm with the correct objects and getting desperate. Thanks again! Best, Anirban -- Anirban Mukherjee | Assistant Professor, Marketing LKCSB, Singapore Management University 5056 School of Business, 50 Stamford Road Singapore 178899 | +65-6828-1932 On Thu, Dec 16, 2010 at 3:

[R] predict.lm with new regressor names

2010-12-15 Thread Anirban Mukherjee
Hi all, Suppose: y<-rnorm(100) x1<-rnorm(100) lm.yx<-lm(y~x1) To predict from a new data source, one can use: # works as expected dum<-data.frame(x1=rnorm(200)) predict(lm.yx, newdata=dum) Suppose lm.yx has been run and we have the lm object. And we have a dataframe that has columns that don't

[R] predict.lm with new regressor names

2010-12-15 Thread Anirban Mukherjee
olves changing the lm object rather than changing the prediction data.frame? Thanks, Anirban -- Anirban Mukherjee | Assistant Professor, Marketing LKCSB, Singapore Management University 5056 School of Business, 50 Stamford Road Singapore 178899 | +65-6828-1932 _

Re: [R] lm: order of dropped columns

2010-07-21 Thread Anirban Mukherjee
:b    2 4.5647 2.28235  2.5804 0.1554 > Residuals  6 5.3070 0.88450 > > Examination of the degrees of freedom tells us that there are two > independent contrasts for a, one independent contrast for b and two > independent contrasts for the interaction of a and b, which are shown

[R] lm: order of dropped columns

2010-07-21 Thread Anirban Mukherjee
Hi all, If presented with a singular design matrix, lm drops columns to make the design matrix non-singular. What algorithm is used to select which (and how many) column(s) to drop? Particularly, given a factor, how does lm choose levels of the factor to discard? Thanks for the help. Best, Anirb