I created a multivariable quantile regression model:
model <- rq(y ~ x1 + x2+ x3... + ns(high_value_x,df=5), tau = seq(0.1, 0.9, by = 0.1), data = df, method='fn')
The high_value_x represent a continuous, numerical variable with very high values (median ~35,000) compared to other variables (categorical 0 to 1, or continuous between -10 to 300).
I have got an error:
> anova(model)
Error in solve.default(D %*% W %*% t(D), D %*% coef) :
system is computationally singular: reciprocal condition number = 3.89884e-19
I found that to obtain results of anova() on my model I need to:
- drop entirely variable
high_value_x - create a new variable by diving
high_value_xby at least100(but without using natural splines for transformation!) (the last solution was inspired by: https://stats.stackexchange.com/questions/76488/error-system-is-computationally-singular-when-running-a-glm)
Initially, I used natural splines to fit nonlinear association between y and high_value_x.
a) How natural splines transformation effects the anova() that I cannot obtain the anova statics?
b) Is it rationale to transform high_value_x by dividing by at least 100 if it has a nonlinear association with dependent variable, and ns() with df = 5 improve fitting in univariate model?
c) Is any other solution for the error?