I have ran a multinomial regression model with multiple independent variables and interactions.
Next, I would like to use this multinom model to predict future values of my outcome variables based on past values.
My end goals is to have a line graph with my predicted outcome versus time from my multinom model and future predictions for the next, let's say, 10 years if all other variables are help constant.
I know of the forecast() function in R, but I believe that would be for linear models, but mine is a multinomial. Any advice on how to proceed?
Thank you.
Related
I have a question concerning ARIMA Errors in ARIMAX models. My data and the model are coming from this site which is based on the forecast package. The model has "expenses" as the endogenous variable and "income" as the exogenous variable where the regression error term is modelled by ARIMA(1,0,2) to handle autocorrelation.
I want to know in detail how the y_t+1 value is forecasted. I know that I am using plausible future values of the exogenous variable "income" and the y_t value since we are having an ARIMA(1,0,2) model. But which values do I use for the eta_t-1 and epsilon_t, epsilon_t-1, epsilon_t-2?
I know that there are residuals listed in the model output (output of "fit$residuals" on the website) but do they belong to eta or epsilon?
I hope I was able to present my problem clearly.
Kind Regards
I was wondering if someone would know an R package that would allow me to fit an Ordinal Logistic regression with a LASSO regularization or, alternatively, a Beta regression still with the LASSO? And if you also know of a nice tutorial to help me code that in R (with appropriate cross-validation), that would be even better!
Some context: My response variable is a satisfaction score between 0 and 10 (actually, values lie between 2 and 10) so I can model it with a Beta regression or I can convert its values into ranked categories. My interest is to identify important variables explaining this score but as I have too many potential explanatory variables (p = 12) compared to my sample size (n = 105), I need to use a penalized regression method for model selection, hence my interest in the LASSO.
The ordinalNet package does this. There's a paper with example here:
https://www.jstatsoft.org/article/download/v099i06/1440
Also the glmnetcr package: https://cran.r-project.org/web/packages/glmnetcr/vignettes/glmnetcr.pdf
I'm trying to estimate a linear regression with arima errors, but my regressors are highly collinear and thus the regression model suffers from multicollinearity. Since my ultimate goal is to be able to interpret the individual regression coefficients as elasticities and to use them for ex-ante forecasting, I need to solve the multicollinearity somehow to be able to trust the coefficients of the regressors. I know that transforming the regressor variables eg. by differencing might help to reduce the multicollinearity. And I have also understood that auto.arima performs the same differencing for both the response variable as well as the regressors defined in xreg (see: Do we need to do differencing of exogenous variables before passing to xreg argument of Arima() in R?).
So my question is, does it do the transformation already before estimating the regression coefficients or is the regression estimated using the untransformed data and transformation done only before fitting the arima model to the errors? And if the transformation is done before estimating the regression, what is the script to get those transformed values to a table or something, to be able to run the multicollinearity test on those rather than the original data?
The auto.arima() function will do the differencing before estimation to ensure consistent estimators. The estimation of the regression coefficients and ARIMA model is done simultaneously using MLE.
You can manually difference the data yourself using the diff() function.
I need to calculate the linear predictor of a Cox PH model by hand.
I can get continuous and binary variables to match the output of predict.coxph (specifying 'lp') but I can't seem to figure out how to calculate it for categorical variables with more than 2 levels.
My aim is to assess calibration of a published model in my own data-I only have coefficients so need to be able to do this by hand.
This previous post describes how to calculate for continuous variables...
(Coxph predictions don't match the coefficients)
Any advice would be appreciated! Thanks
Does a univariate ARIMA model become mulitvariate when I add exogenous variabels to the function? I did this in r with the function xreg.
For example: fitwithtwoexfactors = arima(futoilrtn,order=c(0,0,1), xreg=exogenous)
exogenous is a data frame with two columns.
An ARIMA model does not become a multivariate model. Multivariate models are models with two or more dependent variables. The objective of the exogenous variables is to hopefully make better predictions of the future by minimizing MSE.