Categorical variables

This forum is for posts that specifically focus on Ngene.

Moderators: Andrew Collins, Michiel Bliemer, johnr

Categorical variables

Postby gabriellesod » Fri Apr 05, 2024 5:54 am

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
gabriellesod
 
Posts: 3
Joined: Tue Dec 19, 2023 8:20 pm

Re: Categorical variables

Postby Michiel Bliemer » Sun Apr 07, 2024 4:25 am

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
Michiel Bliemer
 
Posts: 1885
Joined: Tue Mar 31, 2009 4:13 pm


Return to Choice experiments - Ngene

Who is online

Users browsing this forum: No registered users and 10 guests