- Posts: 13
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Random sampling without replacement
- MariaAP
- Topic Author
- Offline
- New Member
Less
More
6 months 1 week ago #251301
by MariaAP
Random sampling without replacement was created by MariaAP
Your LimeSurvey version: 5.6.7
==================
Hi everyone,
I am currently designing a factorial survey with 4 different vignettes. The vignettes describe the behaviours of two people in a romantic relationship. I am not interested in the effect that the sex of the hypothetical people in the vignettes has on the outcome measure but I want to control for this variable. If I randomise the sex (1,2), it is possible that there is an overepresentation of, for example straight or same-sex relationships, in the vignettes participants read (e.g., 3 straight and 1 same-sex). This situation may lead to participants guessing why there are more of one or other type of relationship. To avoid this, I would like participants to be exposed to all four possible combinations (i.e., male-female, female-male, male-male, and female-female), one for each vignette. However, I would like to still randomise the order in which the different sex combinations show by using random sampling without replacement. This is, having a random number selected for vignette 1 (1,4). For vignette 2, having a random number selected between the sex combinations left out (i.e., excluding the one that appears in vignette 1), and so on...
Does anyone perhaps have any ideas on how I could do this?
Thank you very much!
Maria
==================
Hi everyone,
I am currently designing a factorial survey with 4 different vignettes. The vignettes describe the behaviours of two people in a romantic relationship. I am not interested in the effect that the sex of the hypothetical people in the vignettes has on the outcome measure but I want to control for this variable. If I randomise the sex (1,2), it is possible that there is an overepresentation of, for example straight or same-sex relationships, in the vignettes participants read (e.g., 3 straight and 1 same-sex). This situation may lead to participants guessing why there are more of one or other type of relationship. To avoid this, I would like participants to be exposed to all four possible combinations (i.e., male-female, female-male, male-male, and female-female), one for each vignette. However, I would like to still randomise the order in which the different sex combinations show by using random sampling without replacement. This is, having a random number selected for vignette 1 (1,4). For vignette 2, having a random number selected between the sex combinations left out (i.e., excluding the one that appears in vignette 1), and so on...
Does anyone perhaps have any ideas on how I could do this?
Thank you very much!
Maria
Please Log in to join the conversation.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12940
- Thank you received: 3979
6 months 1 week ago #251314
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Random sampling without replacement
Hi,
so you want to display each of the four combinations in random order.
The buzzword is "randomization group name".
4 groups with the same randomization group name.
Further questions?
Provide the lss export of a sample survey.
Joffm
so you want to display each of the four combinations in random order.
The buzzword is "randomization group name".
4 groups with the same randomization group name.
Further questions?
Provide the lss export of a sample survey.
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Please Log in to join the conversation.
- MariaAP
- Topic Author
- Offline
- New Member
Less
More
- Posts: 13
- Thank you received: 0
6 months 1 week ago #251352
by MariaAP
Replied by MariaAP on topic Random sampling without replacement
Hi Joffm,
Thank you for your response.
So what I want to do is to randomise the order of the 4 combinations. I am using the piping feature to tailor the information shown in the four different vignettes based on certain variables (i.e., sex of the people in the vignette and frequency of the behaviours described in the vignette). For this, I had created a random number for each variable. For example, these are the equations for the questions to generate a random number from 1 to 2 for the first vignette:
- if(is_empy(randperpsexual), rand(1,2), randperpsexual)
- if(is_empy(randvictimpsexual), rand(1,2), randvictimsexual)
- if(is_empy(randfreqsexual), rand(1,2), randfreqsexual)
Then, in the vignette, I use piping to tailor the vignette based on the random number that is generated (e.g., if(randperpsexual==1, "Harrison", if(randperpsexual==2, "Hannah"). I have attached the lss of an example of how the vignettes are looking like at the moment.
However, instead of having the questions/variables "randperp" and "randvictim", what I would like achieve is to randomise the order of the four different possible sex combinations and use piping in each of the vignettes. For example, if we say that the values for a new question/variable "randsexcombination" are: 1= famle-male, 2=male-female, 3=female-female, 4=male-male, would it be possible to randomise the order of these numbers (without replacement) and pipe the result in the vignette?
I am unsure if it is possible to do this in limesurvey at all. If not, happy to hear any workarounds!
Thank you very much. Really appreciate your time and help.
Maria
Thank you for your response.
So what I want to do is to randomise the order of the 4 combinations. I am using the piping feature to tailor the information shown in the four different vignettes based on certain variables (i.e., sex of the people in the vignette and frequency of the behaviours described in the vignette). For this, I had created a random number for each variable. For example, these are the equations for the questions to generate a random number from 1 to 2 for the first vignette:
- if(is_empy(randperpsexual), rand(1,2), randperpsexual)
- if(is_empy(randvictimpsexual), rand(1,2), randvictimsexual)
- if(is_empy(randfreqsexual), rand(1,2), randfreqsexual)
Then, in the vignette, I use piping to tailor the vignette based on the random number that is generated (e.g., if(randperpsexual==1, "Harrison", if(randperpsexual==2, "Hannah"). I have attached the lss of an example of how the vignettes are looking like at the moment.
However, instead of having the questions/variables "randperp" and "randvictim", what I would like achieve is to randomise the order of the four different possible sex combinations and use piping in each of the vignettes. For example, if we say that the values for a new question/variable "randsexcombination" are: 1= famle-male, 2=male-female, 3=female-female, 4=male-male, would it be possible to randomise the order of these numbers (without replacement) and pipe the result in the vignette?
I am unsure if it is possible to do this in limesurvey at all. If not, happy to hear any workarounds!
Thank you very much. Really appreciate your time and help.
Maria
Please Log in to join the conversation.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12940
- Thank you received: 3979
6 months 6 days ago #251358
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Random sampling without replacement
Hi,
you already are aware that simple random numbers in each group won't work.
No, you have to create one general random number.
If you think it over, you see that there are 24 different outcomes
1: MM MF FM FF
2: MM MF FF FM
3: MM FM MF FF
...
24: FF FM MF MM
So, you create a random number (1-24) and you get the four unique combinations.
To make it shorter I used
1 = MM
2 = MF
3 = FM
4 = FF
In equation "eqBase" we get the order according to the random number, eg '3142', meaning
V1: FM
V2: MM
V3: FF
V4: MF
The following equations (v1 - v4) give the combination od each vignette.
Now a word to your usage of the IF function.
The If-function is defined as
if(condition, TRUE part, FALSE part)
So this is not really correct, though it works
{if(randperpmonitor==1, "Samuel", if(randperpmonitor==2, "Olivia"))}
Better:
{if(randperpmonitor==1, "Samuel", "Olivia")}
In the sample you should hide all questions of group "GCalc"; it is still visible that you see what happens
And it is only implemented in Vignette 1
Joffm
you already are aware that simple random numbers in each group won't work.
No, you have to create one general random number.
If you think it over, you see that there are 24 different outcomes
1: MM MF FM FF
2: MM MF FF FM
3: MM FM MF FF
...
24: FF FM MF MM
So, you create a random number (1-24) and you get the four unique combinations.
To make it shorter I used
1 = MM
2 = MF
3 = FM
4 = FF
In equation "eqBase" we get the order according to the random number, eg '3142', meaning
V1: FM
V2: MM
V3: FF
V4: MF
The following equations (v1 - v4) give the combination od each vignette.
Now a word to your usage of the IF function.
The If-function is defined as
if(condition, TRUE part, FALSE part)
So this is not really correct, though it works
{if(randperpmonitor==1, "Samuel", if(randperpmonitor==2, "Olivia"))}
Better:
{if(randperpmonitor==1, "Samuel", "Olivia")}
In the sample you should hide all questions of group "GCalc"; it is still visible that you see what happens
And it is only implemented in Vignette 1
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: MariaAP
Please Log in to join the conversation.
- MariaAP
- Topic Author
- Offline
- New Member
Less
More
- Posts: 13
- Thank you received: 0
6 months 3 days ago #251401
by MariaAP
Replied by MariaAP on topic Random sampling without replacement
Hi Joffm,
Thank you so much for your explanation and the attachment. This is incredibly helpful! Also, thank you for your comment on the IF function. Will make sure to use it correctly.
Really appreciate your time and help.
Best,
Maria
Thank you so much for your explanation and the attachment. This is incredibly helpful! Also, thank you for your comment on the IF function. Will make sure to use it correctly.
Really appreciate your time and help.
Best,
Maria
Please Log in to join the conversation.