s-news
[Top] [All Lists]

lm regression problem

To: <s-news@lists.biostat.wustl.edu>
Subject: lm regression problem
From: "yencheng" <yencheng@u.washington.edu>
Date: Mon, 28 May 2007 20:03:29 -0700
Hello,
 
I have been having problems running the following regression using "lm". 
 
I have two timeSeries objects, a and b.  They have the same number of the columns but different rows.
 
> dim(a)
[1]  312 5435
> dim(b)
[1]  104 5435
>
 
I need to run linear regressions across two different rows from the two objects like the following, but keeps getting the following error message:
 
> lm(a@data[16,]~b@data[5,],na.action="">)
Problem: Length of
a@data[16,  ] (variable 1) is 5435 != length of others
(1)
Use traceback() to see the call stack
 
Both objects have the same number of columns, is this due to the timeSeries objects?
 
Thanks,
 
Yen-cheng
 
-----------------------------------------------------------------
Yen-cheng Chang
PhD Student in Finance
University of Washington Business School
<Prev in Thread] Current Thread [Next in Thread>
  • lm regression problem, yencheng <=