2

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)

7
  • stackoverflow.com/questions/62121234/… Commented Dec 3 at 7:15
  • Yes, that is a similar question @Edward, thank you, however, it does not answer my question about the standard errors. Commented Dec 3 at 7:18
  • I think it is the same as the dupe identified. To give any further meaningful comment we would need to see some of your example outputs of the code working in grams and kilograms (and with enough decimal places displayed to be meaningful - prefer scientific notation n.nnne-mm). Commented Dec 3 at 8:57
  • 1
    Hi @MartinBrown If you run the code you can see for yourself, that is exactly why I provided a minimal example. Commented Dec 3 at 10:01
  • 2
    Note that the docs for multinom say 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 Commented Dec 3 at 15:13

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.