[R] ivreg postestimation

2010-05-22 Thread Dipankar Basu
Hi All, I am trying to do an instrumental variables regression with time series data in R 2.11.0. I am using the package AER and have so far used "ivreg" for estimation. I would also like to do some postestimation tests: test for endogeniety, test of overidentifying restrictions and test of weak i

Re: [R] question about rolling regressions

2010-05-07 Thread Dipankar Basu
Thanks. On Thu, May 6, 2010 at 7:49 PM, Gabor Grothendieck wrote: > See ?rollapply in the zoo package. > > On Thu, May 6, 2010 at 6:20 PM, Dipankar Basu wrote: > > Hi All, > > > > I am using R 2.11.0 on a Ubuntu machine. I have a time series data set > and >

[R] question about rolling regressions

2010-05-06 Thread Dipankar Basu
Hi All, I am using R 2.11.0 on a Ubuntu machine. I have a time series data set and want to run rolling regressions with it. Any suggestions would be useful. Here are the details: (1) I convert relevant variables into time series objects and compute first differences: vad <- ts(data$ALLGVA/data$

Re: [R] question about 2SLS

2010-05-02 Thread Dipankar Basu
n this? Is there any reason to prefer one to the other? Deepankar On Sun, May 2, 2010 at 3:51 PM, Achim Zeileis wrote: > On Sun, 2 May 2010, Dipankar Basu wrote: > > Hi All, >> >> I am using R 2.11.0 on a Ubuntu machine. I estimated a model using "tsls" >>

Re: [R] question about 2SLS

2010-05-02 Thread Dipankar Basu
Please ignore my previous message about the difference between "tsls" and "ivreg" results; that was my mistake. Deepankar On Sun, May 2, 2010 at 5:10 PM, Dipankar Basu wrote: > Thanks. > > Estimation of the same model with the same dataset gives different result

[R] question about 2SLS

2010-05-02 Thread Dipankar Basu
Hi All, I am using R 2.11.0 on a Ubuntu machine. I estimated a model using "tsls" from the package "sem". Is there a way to get Newey West standard errors for the parameter estimates? When estimating the model by OLS, I used "NeweyWest" from the package "sandwich" to get HAC standard errors. But,

Re: [R] question about time series objects

2010-01-30 Thread Dipankar Basu
cify the index twice): > > > # 3 > > library(zoo) > > coredata(window(as.zoo(tt), index = 1961.5)) > [1] 0.92 > > (Without coredata it returns a length 1 zoo series rather than just a > number.) > > On Sat, Jan 30, 2010 at 9:22 AM, Dipankar Basu wrote: > &

[R] question about time series objects

2010-01-30 Thread Dipankar Basu
Hi All, I have a very simple question about a time series object: how to access values for a particular year and quarter (say)? Suppose, following http://www.stat.pitt.edu/stoffer/tsa2/R_time_series_quick_fix.htm I have read in data as a time series; here is how it looks. * Qtr1 Qtr2 Q

[R] scatter plot question

2009-03-03 Thread Dipankar Basu
Hi R Users, I have a dataframe like this: id x rho A 1 0.1 B 20 0.5 C 2 0.9 ... I want to do a scatter plot of "x" versus "rho" but for each point on the scatter plot I want the corresponding entry for "id" instead of points. In STATA I can do so by twoway (scatter x rho, mlabel(id))

[R] question about 3-d plot

2009-02-26 Thread Dipankar Basu
Hi R Users, I have produced a simulated scatter plot of y versus x tightly clustered around the 45 degree line through the origin with the following code: x <- seq(1,100) y <- x+rnorm(100,0,10) plot(x,y,col="blue") abline(0,1) Is there some way to generate a 3-dimensional analogue of this? C

[R] question about subseting a dataframe

2008-05-09 Thread Dipankar Basu
Hi! I am using R version 2.7.0 and am working on a panel dataset read into R as a dataframe; I call it "ex". The variables in "ex" are: id year x id: a character string which identifies the unit year: identifies the time period x: the variable of interest (which might contain NAs). Here is an