Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

Categorial variable in linear regression ?

Hi JASPers,

Anyone known if it is possible to run a classical linear regression with a categorial variable as a covariate ?

It seems that the covariate field only accept scale variable, but in the Data library/4.regression/Album sales, there is a example (attached picture) with a categorial variable... and it seems to work properly. For sure it is possible to run this with R code.

Dimitri


Comments

  • I also have this problem after installing JASP 0.14.1. Neither nominal or ordinal covariates are possible to add as covariates. A possible work around is to set them to scale variable but it is not really satisfactory.

  • It is only linear regression that has this problem. Apparently it works to add all types of covariates in a classical logistic regression.

  • Yes, good question. The next version of JASP will allow factors to be added as factors. Previously we did allow factors to be added as predictors, but they were not analyzed as factors.

    Cheers,

    E.J.

  • This is a bug with version 0.14. Categorial variable as covariate faor linear regression works perfectly with version 0.13. I downgraded JASP to version 0.13!

  • Previously we did allow factors to be added as predictors, but they were not analyzed as factors.

    That's indeed the reason why you can't add factors. In this case, the ordinal variable attract is analyzed as if it were a continuous variable. You can replicate this yourself by changing the level of the variable:

    If you change it to scale then you'll obtain the same results as in the data library.

    In the next version of JASP, it will be possible to add factors again.

Sign In or Register to comment.