nested statment in expression


Author
Message
Kugel
Kugel
Associate Member (264 reputation)Associate Member (264 reputation)Associate Member (264 reputation)Associate Member (264 reputation)Associate Member (264 reputation)Associate Member (264 reputation)Associate Member (264 reputation)Associate Member (264 reputation)Associate Member (264 reputation)
Group: Awaiting Activation
Posts: 4, Visits: 24
Hi, 

I am relatively new to inquisit and have started to create some experiments as well as surveys. In one of the surveys, I am measuring BMI. Due to the fact that there are differences across gender when it comes to categorizing people based on their BMI, I wanted to use the raw BMI score in order to assign people to different weight groups conditional on sex. I have used a nested statement within an expression in order to do so. As long as I don't include this newly created expression within my summary data everything is fine, but once I enter it, inquisit shuts down at the end of the survey after all survey items have been filled in and  the finish button has been pressed. Strangely, I am able to run the survey, and I don't get any kind of error messages. This makes it hard for me as a novice to figure out what exactly is wrong with my code. Since I don´t get any summary files for these runs, I am absolutely sure that the problem arises due to adding this expression to the summary data. 

This is the code for the expression: 
/ BMICAT = {(if radiobuttons.Geschlecht.response == 1)
{
if (expressions.BMI < 20)
{
expressions.BMICAT == 1;
}
else if (expressions.BMI >= 20 && expressions.BMI < 25)
{
expressions.BMICAT == 2;
}
else if (expressions.BMI >= 25 && expressions.BMI <30)
{
expressions.BMICAT == 3;
}
else if (expressions.BMI >= 30 && expressions.BMI < 35)
{
expressions.BMICAT == 4;
}
else if (expressions.BMI >= 35 && expressions.BMI < 40)
{
expressions.BMICAT == 5;
}
else if (expressions.BMI >= 40)
{
expressions.BMICAT == 6;
}
}
}

This is just the code for males (thus having answered radiobuttons.Geschlecht with response 1). 

Hope that somebody can help me out and tell me what exactly went wrong, so that I can adapt the code. 

Cheers, 

Kugel
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Reading This Topic

Explore
Messages
Mentions
Search