Page 1 of 1

Categorical variables

PostPosted: Fri Apr 05, 2024 5:54 am
by gabriellesod
Dear Professors,

I am trying to design an experiment where one attribute is the degree of self-sufficiency achievable when installing solar panels (5 h, 10 h, 24 h, or 0 h), and I want to code this as a categorical variable.

However, I get the following error message

"Error: An attribute has the wrong number of levels for dummy or effects coding. 'strg' "

after running a code containing the following line of code within an orthogonal design:

"b3.dummy * strg[0, 1, 2, 3]"

Is this because I have an orthogonal design or that I have no priors?

What am I doing wrong? Should I rather code this as a continuous variable?

Thank you in advance and best regards,
Gabrielle Söderberg

Re: Categorical variables

PostPosted: Sun Apr 07, 2024 4:25 am
by Michiel Bliemer
The error arises because the number of priors is not consistent with the number of attribute levels. The following will work:

b3.dummy[0|0|0] * strg[0, 1, 2, 3]

Michiel