[R] Help from Bill Liao

2009-10-09 Thread Xianchun Liao
Dear Matthieu or other friends, I want to select two unknown thresholds with the following function: grid<- selectSETAR(x1, m=1, thDelay=0, criterion=C("AIC","SSR"), nthresh=2) print(grid) plot(grid) where x1 is a price time series. However, it always shows the following error. Er

[R] How to test for weak exogenity and specify long-run relation with r=2 from Bill

2008-11-06 Thread Xianchun Liao
I am an R beginner and trying to run a market model using supply and demand in R framework. First, I conducted cointegration test. The results showed that there were two ranks. Now I need to test weak exogenity for each series of the seven variables(my data have 7 variables). Then I ne

[R] Help for SUR model

2008-09-22 Thread Xianchun Liao
I am an R beginner and trying to run a SUR model in R framework. subset(esasp500, Obs <=449 & Obs>=197, select = -Date) ->ev13sub c(Obs>=397) & c(Obs<=399) ->d13 c(Obs>=400) & c(Obs<=449) ->f13 SP500*f13 ->SP500f13 BBC~SP500+d13+SP500f13 ->sur132 BOW~SP500+d13+SP500f13 ->sur133 CSK~S

[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