I have the following R code that performs a multinomial logistic regression.
When scaling birthweight from grams (original data) to kg (more similar scale as other variables and easier interpretation) my standard errors change and with that the p-values and significance of many variables in my multivariable regression model. This is already seen in the model with only birthweight as variable as in my minimal example. Can anyone please help me figure out why the standard errors and thus p-values are changing? In SPSS this does not happen and I have no idea why this differs over methods.
Any help and insights are highly appreciated!
library(nnet)
# Simulate data
set.seed(123)
n <- 500
clusters <- sample(LETTERS[1:5], n, replace = TRUE)
birthweight_g <- rnorm(n, 3400, 500) # grams
birthweight_kg <- birthweight_g / 1000 # kilograms
df <- data.frame(
cluster = relevel(factor(clusters), ref = "D"),
birthweight_g = birthweight_g,
birthweight_kg = birthweight_kg
)
# Model with grams
model_g <- multinom(cluster ~ birthweight_g, data = df, Hess = TRUE)
summary_g <- summary(model_g)
print(summary_g)
# Model with kilograms
model_kg <- multinom(cluster ~ birthweight_kg, data = df, Hess = TRUE)
summary_kg <- summary(model_kg)
print(summary_kg)
multinomsay this:multinom calls nnet. The variables on the rhs of the formula should be roughly scaled to [0,1] or the fit will be slow or may not converge at all.I understand the models are converging here (may be worth raising with the package author) but multinom expects predictors to be on a particular scale