search for: xlag

Displaying 7 results from an estimated 7 matches for "xlag".

Did you mean: flag
2003 May 29
2
Newbie trying to Lag Variables in a regression
Perhaps I am making this too hard, but how does one regress y(t) on a constant, x(t-1) and y(t-1)? I've tried the manuals and until I get Dalgaard's book (just ordered on Amazon), I am stuck! Thanks to all in advance for your patience and consideration.
2002 Feb 12
6
A couple of little R things I can't figure out (column percents, regression with lagged variables)
...x 1 2 4 1 100 66.67 0 3 0 0 80 4 0 33.33 20 Pointers appreciated. 2. A student said here's y, a vector representing a time series, and here's x, a vector representing a time series. I want to do a conventional regression of y on the lag of x. In sas you do xlag=lag(x) and then use xlag in a regresson. I just want something simple like lm(y~lag(x)). But in R base there's no lag. So I can get it the old fashioned way: > xx <- c(NA,x) > modl <- lm(y~xx[1:length(y)]) > summary(modl) One sidenote is that summary does not include any...
2012 Jun 16
2
How to specify "newdata" in a Cox-Modell with a time dependent interaction term?
...---------------------- fold <- function(data, time, event, cov, cov.names=paste('covariate', '.', 1:ncovs, sep=""), suffix='.time', cov.times=0:ncov, common.times=TRUE, lag=0){ vlag <- function(x, lag) c(rep(NA, lag), x[1:(length(x)-lag)]) xlag <- function(x, lag) apply(as.matrix(x), 2, vlag, lag=lag) all.cov <- unlist(cov) if (!is.list(cov)) cov <- list(cov) ncovs <- length(cov) nrow <- nrow(data) ncol <- ncol(data) ncov <- length(cov[[1]]) nobs <- nrow*ncov if (length(uniqu...
2010 Aug 31
2
simultaneous estimation
Hi folks, Not sure what this sort of estimation is called. I have a 2-column time-series x(i,t) [with (i=1,2; t=1,...T)], and I want to do the following 'simultaneous' regressions: x(1,t) = (d - 1)(x(1, t-1) - mu(1)) x(2,t) = (d - 1)(x(2, t-1) - mu(2)) And I want to determine the coefficients d, mu(1), mu(2). Note that the d should be the same for both estimations, whereas the
2007 Jun 04
1
Help with conditional lagging of data
...d below a sample of the data Input file sample ID Year X AB12 2000 100 AB12 2001 120 AB12 2002 140 AB12 2003 80 BL14 2000 180 BL14 2001 150 CR93 2000 45 CR93 2001 49 CR93 2002 56 CR93 2003 67 Expected output from this data ID Year Xlag AB12 2000 . AB12 2001 20 AB12 2002 20 AB12 2003 -60 BL12 2000 . BL14 2001 -30 CR93 2000 . CR93 2001 5 CR93 2002 7 CR93 2003 9 Can somebody please help me with how to implement this in R. Thanks. Sincerely Anup -------------------------...
2013 Feb 26
1
Light Libraries
...all, a lagseries function.) @USAGE lagseries( seriesin, numlags =1, panelid=NULL) @ARGUMENTS seriesin: a numeric vector numlags: an integer, can be negative panelid: an optional panel id @DETAILS None @SEEALSO leadseries, chgseries, pchgseries, compoundseries @EXAMPLES x <- rnorm(10) xlag <- lagseries(x,2) lm( x ~ xlag ) d <- data.frame( x <- c( rnorm(20), runif(30), rcauchy(40) ), who= c( rep("firm1",20), rep("firm2", 30), rep("firm3",40)), year= c( 1961:1980, 1971:2000, 1971:2010 ) ) lagd <- data.frame(...
2003 Jun 10
1
Regression output labels
...the names given to the regressors in the output. I understand what "xGE" stands for in a standard "lm" test involving an independent variable GE for instance, but if I lags and or differences are included in the model, what do the following "output" stand for: "xlag(x,-1)GE" "xD.GE" "xD.lag(diff(x), -i)GE" "xD.D.lag(diff(x), -i)GE" Thanks for the clarifications -- I don't want to "misspeculate" on the actual interpretations, here... Also... 2. When an Engle-Granger test is run on multiple independ...