Cross Validated Asked by Fabio on September 21, 2020
I am new to R and only know the very basics. Currently I am trying to estimate a model which is very simple, but I have problems thinking about how to set it up. Precisely, I am trying to estimate the following equation:
a(t) - a(t-1) = alpha + beta1 c(t) + beta2 c(t+1)
My data consists of 341 scenarios and each scenario calculates me 10 values for a and 10 values for c, meaning I got "10 ts", which gives me in total 341x2x10 = 6820 data points.
My problem is that I don’t know how to set this up. I brought my data already into tidy format and now I just want to get started, but how?
Looping approach
Should I try to estimate this equation for 1 scenario and then try to loop the resulting code over the other scenarios? And if yes, how exactly would I do so? By using the diff() function, storing the result somewhere, looping over the other 340 scenarios, which would give me 341 stored results? How would I then combine these 341 results in the end?
Time series / panel data approach
Should I rather focus on "the panel data character" of my data? (to be honest I am not even sure if it’s panel data or time series). In that case I would read a bit more into working with time series / panel data.
I am sure there are several options to do this (quite basic) estimation. I just don’t know which way to go, and once I decide for a specific way, how to carry it out and set it up.
I would just like to have a kind of roadmap for how to set this whole thing up.
My advice is go for panel, the best choice here.
https://cran.r-project.org/web/packages/plm/vignettes/plmPackage.html
Really simple package to understand and a good example in this link.
Answered by josef_joestarr on September 21, 2020
0 Asked on December 29, 2021 by bioinformatics_student
machine learning neural networks prediction interval regression
0 Asked on December 29, 2021 by tjaqu787
4 Asked on December 29, 2021 by nicolas-molano
1 Asked on December 29, 2021
2 Asked on December 29, 2021 by ahsan
3 Asked on December 27, 2021 by tsteatime
correlation matrix matrix inverse multicollinearity regression
1 Asked on December 27, 2021 by string_is_hard
2 Asked on December 27, 2021 by sgtbp
3 Asked on December 27, 2021
feature selection generalized linear model multiple regression r regression
2 Asked on December 27, 2021 by baktaawar
0 Asked on December 27, 2021 by 1111ktq
binary data clustering sample size statistical significance sufficient statistics
1 Asked on December 27, 2021
2 Asked on December 27, 2021
1 Asked on December 27, 2021 by af1402
lme4 nlme multilevel analysis panel data r repeated measures
0 Asked on December 27, 2021
0 Asked on December 27, 2021 by ruffybeo
0 Asked on December 27, 2021
0 Asked on December 27, 2021 by lakshman
Get help from others!
Recent Answers
Recent Questions
© 2023 AnswerBun.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP