Re: [R] how to calcaulate matrices for two subsets

2008-09-11 Thread Adam D. I. Kramer
Hi Bill, Tell me more about the Obs object. The "subset" of an lm should be a vector telling the lm which observations to use...if Obs[197,396] is a single number, only one observation will be used, and chances are your model is not what you intended. Also, predict(result1,newdata=Obs[397,339])

[R] how to calcaulate matrices for two subsets

2008-09-11 Thread Xianchun Liao
I am an R beginner and trying to run a market model using event study in R framework. First, I run a market model, that is lm(stock security~SP500 index, subset=Obs[197, 396]) ->result1 Then I get predict results for a new dataset using predict (result1, newdata=Obs[397,399]) ->pred1 Pred1 s