search for: lag2

Displaying 14 results from an estimated 14 matches for "lag2".

Did you mean: flag2
2002 Jun 20
1
Possible bug with glm.nb and starting values (PR#1695)
...). An example: ________________________________________________________________ library(MASS) y<-c(7,5,4,7,5,2,11,5,5,4,2,3,4,3,5,9,6,7,10,6, 12,6,3,5,3,9,13,0,6,1,2,0,1,0,0,4,5,1,5,3,3,4) lag1<-c(0,7,5,4,7,5,2,11,5,5,4,2,3,4,3,5,9,6,7,10,6, 12,6,3,5,3,9,13,0,6,1,2,0,1,0,0,4,5,1,5,3,3) lag2<-c(0,0,7,5,4,7,5,2,11,5,5,4,2,3,4,3,5,9,6,7,10,6, 12,6,3,5,3,9,13,0,6,1,2,0,1,0,0,4,5,1,5,3) lag3<-c(0,0,0,7,5,4,7,5,2,11,5,5,4,2,3,4,3,5,9,6,7,10,6, 12,6,3,5,3,9,13,0,6,1,2,0,1,0,0,4,5,1,5) ># first a poisson model which is OK >glm(y~lag1+lag2+lag3,family=poisson(link=identity)) Er...
2013 Apr 26
1
Regression coefficients
Hi all, I have run a ridge regression as follows: reg=lm.ridge(final$l~final$lag1+final$lag2+final$g+final$g+final$u, lambda=seq(0,10,0.01)) Then I enter : select(reg) and it returns: modified HKB estimator is 19.3409 modified L-W estimator is 36.18617 smallest value of GCV at 10 I think it means that it is...
2012 Feb 03
1
A question on Unit Root Test using "urca" toolbox
...1Q Median 3Q Max -2.43555 -0.63440 -0.03048 0.53522 2.84237 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 0.238631 0.137262 1.739 0.084944 z.lag.1 -0.153030 0.061841 -2.475 0.014881 z.diff.lag1 0.011463 0.090330 0.127 0.899252 z.diff.lag2 0.008764 0.089850 0.098 0.922479 z.diff.lag3 0.149529 0.088930 1.681 0.095546 z.diff.lag4 -0.349870 0.088847 -3.938 0.000145 (Intercept) . z.lag.1 * z.diff.lag1 z.diff.lag2 z.diff.lag3 . z.diff.lag4 *** --- Signif. codes: 0 ?***? 0.001 ?**? 0.01 ?*? 0.05 ?.? 0.1 ? ? 1 Residual s...
2013 Apr 27
1
Selecting ridge regression coefficients for minimum GCV
Hi all, I have run a ridge regression as follows: reg=lm.ridge(final$l~final$lag1+final$lag2+final$g+final$u, lambda=seq(0,10,0.01)) Then I enter : select(reg) and it returns: modified HKB estimator is 19.3409 modified L-W estimator is 36.18617 smallest value of GCV at 10 I think it means that it is advisab...
2008 May 22
1
How to account for autoregressive terms?
...;)]) indep.ret3 &lt;- ts(data.df[selection,c("RET3")]) indep.ret4 &lt;- ts(data.df[selection,c("RET4")]) indep.ret5 &lt;- ts(data.df[selection,c("RET5")]) d&lt;-ts.union(dep,indep.ret1,indep.ret2,indep.ret3,indep.ret4,indep.ret5,dep.lag1=lag(dep,-1),dep.lag2=lag(dep,-2),dep.lag3=lag(dep,-3)) fit1 &lt;- lm(dep~indep.ret1+indep.ret2+indep.ret3+indep.ret4+indep.ret5+dep.lag1+dep.lag2+dep.lag3,data=d) summary(fit1) #coeftest(fit1,vcov=NeweyWest) 2) using armaFit: fit2&lt;-armaFit(dep~ar(3),xreg=ts(data.df[selection,c("RET1","RET2&qu...
2012 Mar 19
1
Lag based on Date objects with non-consecutive values
Hello all, I need to figure out a way to lag a variable in by a number of days without using the zoo package. I need to use a remote R connection that doesn't have the zoo package installed and is unwilling to do so. So that is, I want a function where I can specify the number of days to lag a variable against a Date formatted column. That is relatively easy to do. The problem arises when I
1999 May 06
0
matrix weirdness
I am using R on unix version 63.0 I am doing an image plot of the following data file: ================================ lag1 lag2 cif2d 0.000 0.000 NaN 0.000 1.000 0.500000 0.000 2.000 0.489831 0.000 3.000 0.492986 0.000 4.000 0.493409 0.000 5.000 0.492727 0.000 6.000 0.494485 1.000 0.000 0.500000 1.000 1.000 NaN 1.000 2.000 0.495098 1.000 3.000 0.489831 1.000 4.000 0.492986 1.000 5.000 0.493409 1.000 6.000 0.495455...
1999 May 06
0
image weirdness
I am using R 63.0. Now let's try this simple image plot. Here is the data file: ============================ lag1 lag2 cif2d 1 1 11 1 2 12 1 3 13 2 1 21 2 2 22 2 3 23 3 1 31 3 2 32 3 3 33 ==================== data<-read.table("~/r/rt/data/unif/junk.out",header=TRUE) x<-unique(data$lag1) y<-unique(data$lag2) z<-matrix(data$cif2d,length(y),length(x)) At this point, see the z matrix: > z...
2013 Apr 30
0
Ridge regression
Hi all, I have run a ridge regression on a data set 'final' as follows: reg=lm.ridge(final$l~final$lag1+final$lag2+final$g+final$u, lambda=seq(0,10,0.01)) Then I enter : select(reg) and it returns: modified HKB estimator is 19.3409 modified L-W estimator is 36.18617 smallest value of GCV at 10 I think it means that it is advisab...
2008 Jan 31
1
Feature request: about lag(), which.min() and cat().
Hello I'm only user of R and have many little knowledge in programming but I permit to send you some whishes/suggestions for R. which.min like which(), which.min() should also include an argument arr.ind. Note that one can have it with which(a==min(a), arr.ind=TRUE) but if there is a reason to build a special function which.min, why not add also this nice argument? lag() If one wants to
2012 Dec 03
2
How to rename the columns of as.table
...G -0.087313283 -0.039602008 -0.036173594 -0.052246520 -0.059179674 -0.041706488 0.031601299 H I J -0.005105154 0.016379572 0.058881676 Now i don't want the names A,B,C,D ..... etc, but i want to rename it with : Lag1, Lag2, Lag3 ... I know that it can be done with fix(autocorrelazione1), but i need somthing in the initial formula. I tried with dnn=list.names("lag1" , .... , "lag10") but the names remain the same. Some help? Thanks guys -- View this message in context: http://r.789695.n4.nabble....
2023 Jan 16
1
(no subject)
...ice, start = c(2020, 22), frequency = 365) roilt=ts(diff(log(oil$price))*100,start=c(2020,22),freq=365) # Fit MSW model ---- roilt.lag0 = window(roilt,start=c(2020,23),end=c(2021,215),freq=365) # get al the lags right roilt.lag1 = window(roilt,start=c(2020,22),end=c(2021,214),freq=365) roilt.lag2 = window(roilt,start=c(2020,20),end=c(2021,213),freq=365) roilt.lag3 = window(roilt,start=c(2020,20),end=c(2021,212),freq=365) roilt.lag4 = window(roilt,start=c(2020,19),end=c(2021,211),freq=365) I am getting error (length is not matching), while creating lag. I will grateful to you if you can...
2007 Jul 12
2
lead
Hi, is there any function in R that shifts elements of a vector to the opposite direction of what Lag() of the Hmisc package does? (something like, Lag(x, shift = -1) ) Thanks Zava -------------------------------------------------------- This is not an offer (or solicitation of an offer) to buy/se...{{dropped}}
1999 May 06
1
x,y vs row,column
I think my problems are coused by a fundamental R incompatibility in how matrices are stored and the usual way of specifying Cartesian coordinates. When I do data<-read.table("~/r/rt/data/unif/6cbcif2d.out",header=TRUE) x<-unique(data$lag1) y<-unique(data$lag2) z<-matrix(data$cif2d,length(y),length(x)) This z matrix is printed apparently correctly from a Cartesian point of view > z [,1] [,2] [,3] [1,] 11 21 31 [2,] 12 22 32 [3,] 13 23 33 But if you look at the numbers on the top and side you see that the row and column inde...