I have a set of 32 intercorrelated variables and a target. I hypothesised that these variables would linearly and positively contributed to the target, and hence a non-negative linear regression model is adopted. However, I would like to investigate on the relative importance of variables, instead of the correlation coefficient, given the multicollinearity of the variables. It seems that the relative importance analysis (Johnson & LeBreton, 2004) did not allow a non-negative constraints. Is there any kinds of analysis that I retrieve the relative importance while maintaining the non-negative constraints? Lots of thanks!

  • $\begingroup$ Welcome to Cross Validated! Was hoping to get clarity on what is meant by 'these variables would linearly and positively contribute to the target'. Does this literally mean that all the linear regression coefficients are constrained to be non-negative by the estimator? I ask as to clarify that you do not mean that the outcome must be non-negative like a log-linear regression or (quasi-)Poisson regression model. $\endgroup$
    – jluchman
    Nov 18, 2022 at 15:14
  • $\begingroup$ @jluchman Yes, the coefficients are constrained while the outcome can be positive or negative. $\endgroup$
    – Ken Chan
    Nov 18, 2022 at 15:25

1 Answer 1


This can be accomplished using the {domir} package.

For instance, consider this model using nnls::nnls in R.

nnls::nnls(mtcars[c('qsec', 'vs', 'am')] |> as.matrix(), 

Nonnegative least squares model
x estimates: 0.8537898 4.468002 7.16467 
residual sum-of-squares: 317.7
reason terminated: The solution has been computed sucessfully.

That model produces an $R^2$ like:

> nnls::nnls(mtcars[c('qsec', 'vs', 'am')] |> as.matrix(), 
   mtcars$mpg) |> 
   fitted.values() |> cor(mtcars$mpg) |> (\(x){(x**2)[[1]]})()

[1] 0.7179187

This model can be accommodated, with the $R^2$ it produced, using an approach like:

  ~ qsec + vs + am, 
  \(fml, ...) {
    terms <- terms(fml) |> (\(x) attributes(x)[["term.labels"]] )()
    mod <- 
        mtcars[terms] |> as.matrix(), 
    r2 <- mod |> fitted.values() |> cor(mtcars$mpg) |> (\(x){(x**2)[[1]]})()

Overall Value:      0.7179187 

General Dominance Values:
     General Dominance Standardized Ranks
qsec         0.1006883    0.1402503     3
vs           0.2659427    0.3704357     2
am           0.3512877    0.4893140     1

Conditional Dominance Values:
     Subset Size: 1 Subset Size: 2 Subset Size: 3
qsec      0.1752963      0.0948123     0.03195626
vs        0.4409477      0.2600667     0.09681373
am        0.3597989      0.3454117     0.34865241

Complete Dominance Designations:
             Dmnated?qsec Dmnated?vs Dmnated?am
Dmnates?qsec           NA      FALSE      FALSE
Dmnates?vs           TRUE         NA         NA
Dmnates?am           TRUE         NA         NA

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.