Recently I have been working in R to create a logistic regression model to predict the chance of a loan being repaid.
I would like to be able to transfer my model to Excel to allow my co-workers who know nothing about R to use it. I have tried using the coefficients returned from the summary function but they provide answers far outside of 0 and 1.
How can I transfer my regression model to Excel?
The output of a logistic regression model is a log-odds. You would need to take the value from the equations and convert it to a probability between 0 and 1 e.g. 1/(1+exp(-x))
Related
I have a dataset with data left censored and I wanted to apply a multilevel mixed-effects tobit regression, but I only find information about how to do it in Stata. Is it possible to do it in R?
I found the packages 'VGAM' and 'CensREG', but I don't get how to add fixed and random effects.
Also my data is log-normal distributed, is there a way to add this to the model?
Thanks!
According to Section 3.5 of a vignette, the censReg package can handle a mixed model if the data are prepared properly via the plm package.
This Cross Validated page shows an example.
I don't have experience with this; it might only work with formal panel data rather than more general random-effects structures.
If your data are truly log-normal, you could take logs first and set the lower censoring limit on the log scale. Note that an apparent log-normal distribution of outcomes might just represent a corresponding distribution of predictor values with an underlying normal error distribution around the predictions. Don't jump blindly into a log-normal assumption.
I am working with a dataset that is zero inflated and I found a function that allows me to do a GLMM with the glmmadmb function. But, I realized that my data are not linearly related with the environmental variables I want to test, this is why I am looking for a GAMM instead of a GLMM.
Does anyone know which function can replace glmmadmb for a GAMM ?
I usually use R to make my own statistical models based on data that I have.
However, I have recently read about a logistic regression model in a scientific publication and I want to replicate this model to make predictions on some of my own data, which includes the same variables.
Is there a way to "declare" a model in R, based on the coefficients published in the paper?
Is there a way in SAS to compare two regression models using ANOVA. What i want to replicate is - in R if i have 2 models - model1 & model2 i can directly run anova(model1, model2) to find if there is a significant difference between the two.
Is there a way to do the same in SAS.
No, because SAS doesn't store models that way. However, you can run each model (in PROC GLM or whatever) and then compare the results. You can get some of this by looking at the different "types" of error, too.
Does anyone here know how I can specify additional external variables to an ARIMA model ?
In my case I am trying to make a volatility model and I would like to add the squared returns to model an ARCH.
The reason I am not using GARCH models, is that I am only interested in the volatility forecasts and the GARCH models present their errors on their returns which is not the subject of my study.
I would like to add an external variable and see the R^2 and p-values to see if the coefficient is statistically significant.
I know that this is a very old question but for people like me who were wondering this you need to use cbind with xreg.
For Example:
Arima(X,order=c(3,1,3),xreg = cbind(ts1,ts2,ts3))
Each external time series should be the same length as the original.