similar to: Dyn or Dynlm and out of sample forecasts

Displaying 20 results from an estimated 9000 matches similar to: "Dyn or Dynlm and out of sample forecasts"

2008 May 02
2
Extract lags from a formula
Hi folks! How do I extract lags from a formula? An example: mod.eq<-formula(x~lag(x,-1)+lag(x,-2)) > mod.eq x ~ lag(x, -1) + lag(x, -2) > mod.eq[1] "~"() > mod.eq[2] x() > mod.eq[3] lag(x, -1) + lag(x, -2)() I'm trying to extract the lags into a vector that would be simply [1,2]. How do I do this? I'm using the dyn package to do dynamic
2009 Apr 19
1
dynlm question: How to predefine formula for call to dynlm(formula) call
I want to set up a model with a formula and then run dynlm(formula) because I ultimately want to loop over a set of formulas (see end of post) R> form <- gas~price R> dynlm(form) Time series regression with "ts" data: Start = 1959(1), End = 1990(4) <snip> Works OK without a Lag term R> dynlm(gas ~ L(gas,1)) Time series regression with "ts" data: Start =
2009 Nov 23
2
dynlm predict with newdata?
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20091122/6a079ab8/attachment-0001.pl>
2011 Feb 17
2
Regresión lineal para una serie temporal
Hola a todos Estoy intentando hacer un análisis rápido de una serie temporal de datos diarios pero me encuentro con algunos problemas. Me gustaría en primera instancia hacer una regresión lineal pero no encuentro la forma. Tras leer los datos diarios creo un objeto de la clase zoo y sobre éste no puedo utilizar lm(). He leído algo sobre dynlm pero no encuentro la forma. Se agradece
2006 Jun 21
5
colClasses
Hi Folks! I'm reading in some data from a .csv file that has a date column. How do I use colClasses to get read.csv to recognize the date column? The documentation on this seems to be nil - And yes, I've read help and R Data Import/Export and can't figure out what the colClasses syntax is. Thanks, john [[alternative HTML version deleted]]
2003 Jul 30
2
Comparing two regression slopes
Hello, I've written a simple (although probably overly roundabout) function to test whether two regression slope coefficients from two linear models on independent data sets are significantly different. I'm a bit concerned, because when I test it on simulated data with different sample sizes and variances, the function seems to be extremely sensitive both of these. I am wondering if
2010 Apr 08
2
Overfitting/Calibration plots (Statistics question)
This isn't a question about R, but I'm hoping someone will be willing to help. I've been looking at calibration plots in multiple regression (plotting observed response Y on the vertical axis versus predicted response [Y hat] on the horizontal axis). According to Frank Harrell's "Regression Modeling Strategies" book (pp. 61-63), when making such a plot on new data
2007 Dec 07
1
AIC v. extractAIC
Hello, I am using a simple linear model and I would like to get an AIC value. I came across both AIC() and extractAIC() and I am not sure which is best to use. I assumed that I should use AIC for a glm and extractAIC() for lm, but if I run my model in glm the AIC value is the same if I use AIC() on an lm object. What might be going on? Did I interpret these functions incorrectly? Thanks,
2005 Aug 12
1
as.formula and lme ( Fixed effects: Error in as.vector(x, "list") : cannot coerce to vector)
This is a continuing issue with the one on the list a long time ago (I couldn't find a solution to it from the web): -------------------------------------------------------------------------- > Using a formula converted with as.formula with lme leads > to an error message. Same works ok with lm, and with > lme and a fixed formula. > > # demonstrates problems with lme and
2006 Mar 10
1
add trend line to each group of data in: xyplot(y1+y2 ~ x | grp...
Although this should be trivial, I'm having a spot of trouble. I want to make a lattice plot of the format y1+y2 ~ x | grp but then fit a lm to each y variable and add an abline of those models in different colors. If the xyplot followed y~x|grp I would write a panel function as below, but I'm unsure of how to do that with y1 and y2 without reshaping the data before hand. Thoughts
2006 Jun 23
3
Problems with weekday extraction from zoo objects
Hi Folks! I'm struggling with dates - but enough about my personal life..... I have two daily time series files. In one (x) the date format is Y/m/d and the other (y) is d/m/y. I used read.zoo on both and they read into R with no problem. Then I use: weekdays(as.Date(x$DATE)) and get what I expect - all the days of the week in my data set. When I use:
2007 Mar 22
2
dynamic linear models in R
Hi all, I've just started working my way through Mike West and Jeff Harrison's _Bayesian Forecasting and Dynamic Models_, and I was wondering if there were any publically-available packages to handle dynamic linear models, as they describe. I found the "dynlm" package, but either I don't yet understand what's going on or that package uses a different sense of the phrase
2008 Nov 24
3
Is this correct?
I have to answer the following question for a homework assignment. A researcher was interested in whether people taking part in sports at university made more money after graduating, taking into account the students' GPA. They sampled 200 alumni from a large university. The variables are: income (income 10 years after graduating), sports (1 if they did sports, 0 if they did not), and GPA (the
2014 Jun 13
3
p values con LMER
Hola Manuel lo he tratado de hacer pero me sale Error: unexpected string constante in: "anova(a,as,test=Chisq") no tengo ni idea de por qué... Me resulta alucinante no poder contar ya con pvals.fnc. ¿Será imposible hacerse con ello? Saludos, Miguel -------------------------------------------- El vie, 13/6/14, Manuel Azcárate <mazcarategarcia en gmail.com> escribió:
2012 Jul 06
2
Anova Type II and Contrasts
the study design of the data I have to analyse is simple. There is 1 control group (CTRL) and 2 different treatment groups (TREAT_1 and TREAT_2). The data also includes 2 covariates COV1 and COV2. I have been asked to check if there is a linear or quadratic treatment effect in the data. I created a dummy data set to explain my situation: df1 <- data.frame( Observation =
2001 Feb 23
1
as.formula and lme ( Fixed effects: Error in as.vector(x, "list") : cannot coerce to vector)
Using a formula converted with as.formula with lme leads to an error message. Same works ok with lm, and with lme and a fixed formula. # demonstrates problems with lme and as.formula demo<-data.frame(x=1:20,y=(1:20)+rnorm(20),subj=as.factor(rep(1:2,10))) demo.lm1<-lme(y~x,data=demo,random=~1|subj) print(summary(demo.lm1)) newframe<-data.frame(x=1:5,subj=rep(1,5))
2007 Aug 06
1
test the significances of two regression lines
R-help, I'm trying to test the significance of two regression lines , i.e. the significance of the slopes from two samples originated from the same population. Is it correct if I fit a liner model for each sample and then test the slope signicance with 'anova'. Something like this: lm1 <- lm(Y~ a1 + b1*X) # sample 1 lm2 <- lm(Y~ a2 + b2*X) # sample 2 anova(lm1, lm2)
2014 Jun 13
2
p values con LMER
Hola a todos, quería preguntaros un medio para obtener los valores p usando lmer. He tratado con pvals.fnc, que es lo que me habían recomendado, pero por algún motivo no está ya disponible etc. Ésta es la función que tengo, pero da las "t", sin los valores p. Aunque Baayen indica que valores por encima de 2 son significativos necesito saber las p. resultado = lmer(rt_ln ~ (fre_ln *
2012 Jan 13
2
Help needed in interpreting linear models
Dear members of the R-help list, I have sent the email below to the R-SIG-ME list to ask for help in interpreting some R output of fitted linear models. Unfortunately, I haven't yet received any answers. As I am not sure if my email was sent successfully to the mailing list I am asking for help here: Dear members of the R-SIG-ME list, I am new to linear models and struggling with
2011 Nov 30
2
forecasting linear regression from lagged variable
I'm currently working with some time series data with the xts package, and would like to generate a forecast 12 periods into the future. There are limited observations, so I am unable to use an ARIMA model for the forecast. Here's the regression setup, after converting everything from zoo objects to vectors. hire.total.lag1 <- lag(hire.total, lag=-1, na.pad=TRUE) lm.model <-