I think I know what I need to do, I just don't know how to make it work.
Example of Data: data
I have decades of data in Excel in that format, which I uploaded to R. I believe I need to convert it to a time series or date format somehow, but retain the countries as categories so I can run the following regressions:
y ~ x1+x2
x1 ~ x2
y ~ x1
Can anyone share code/packages that can help me accomplish this? It feels simple, but I could not find any examples in a few hours of searching. Would ggplot
also be recommended for producing figures with this data?
I tried converting it to as.xts
, but that did not work, likely because of my poor understanding and the Country column. My failed attempt below:
modelts=as.xts(model1[,-1],order.by=as.Date(model1[,1],format='%m%d%Y'))