Reject command overused?

This forum is for posts that specifically focus on Ngene.

Moderators: Andrew Collins, Michiel Bliemer, johnr

Reject command overused?

Postby atan » Tue Sep 26, 2023 10:26 am

Hi Ngene team,

I am very new to choice experiments and using Ngene. I am conducting a DCE to look at choice preferences between services for a future pandemic response.

I have two alternatives, eight attributes, and levels ranging between 3-5. All of my levels are qualitative/categorical and have dummy coded as such.

design
;alts = service1* , service2*
;rows = 60
;block = 5
?;alg = mfederov
;eff = (mnl,d)
;model:
U(service1) = b1.dummy[0.3|-0.1|0.1] * A_care[0,1,2,3]
+ b2.dummy[0.3|-0.1] * A_education[0,1,2]
+ b3.dummy[0.5|0.1] * Birth_place[0,1,2]
+ b4.dummy[-0.5|0.1|0.2] * Duration[0,1,2,3]
+ b5.dummy[0.2|-0.3|0.1|0.15] * SP_after_birth[0,1,2,3,4]
+ b6.dummy[0.15|-0.3|0.1] * Breastfeeding[0,1,2,3]
+ b7.dummy[0.3|-0.3|0.1] * P_care[0,1,2,3]
+ b8.dummy[0.2|0.5|0.1] * SP_outpatients[0,1,2,3]
/
U(service2) = b1 * A_care
+ b2 * A_education
+ b3 * Birth_place
+ b4 * Duration
+ b5 * SP_after_birth
+ b6 * Breastfeeding
+ b7 * P_care
+ b8 * SP_outpatients

$

I need to reject certain combinations between attributes as they are not realistic, however it seems that I have reached a quota on such reject commands. I have used the commands below and am only able to simultaneously reject up to three at a time. (although just attempted and received an "Error:A logical expression has an incompatible element:"

?service1.Birth_place=2 and service1.Duration=0,
?service1.Birth_place=2 and service1.Duration=1,
?service1.Birth_place=2 and service1.Duration=2,

?service2.Birth_place=2 and service2.Duration=0,
?service2.Birth_place=2 and service2.Duration=1,
?service2.Birth_place=2 and service2.Duration=2,

?service1.Birth_place=2 and service1.SP_after_birth=0,
?service1.Birth_place=2 and service1.SP_after_birth=1,
?service1.Birth_place=2 and service1.SP_after_birth=2,
?service1.Birth_place=2 and service1.SP_after_birth=3,
?service1.Birth_place=2 and service1.SP_after_birth=4,

?service2.Birth_place=2 and service2.SP_after_birth=0,
?service2.Birth_place=2 and service2.SP_after_birth=1,
?service2.Birth_place=2 and service2.SP_after_birth=2,
?service2.Birth_place=2 and service2.SP_after_birth=3,
?service2.Birth_place=2 and service2.SP_after_birth=4,

I'm wondering if there are any other constraint methods I could use? Or even if it is possible to output N/A in attribute levels for attributes (Duration and SP_after_birth)


Thanks in advance,

Annie
atan
 
Posts: 13
Joined: Mon Sep 25, 2023 9:49 pm

Re: Reject command overused?

Postby Michiel Bliemer » Tue Sep 26, 2023 10:53 am

Hi Annie,

I was able to enable all constraints you sent, except one since that will create multicollinearity, which means perfect correlations between two attribute levels such that one or more coefficients cannot be estimated and the D-error becomes infinite.

In the script below I disabled the last constraint and this works. If you include the last constraint, there will be multicollinearity.
You could try leaving another constraint out, or you should aggregate attributes into a single attribute with combinations of allowable levels.

Note that the LAST level in Ngene is the reference level, so b1.dummy[0.3|-0.1|0.1] * A_care[0,1,2,3] means that 0.3 utility is attached to level 0, relative to level 3 (which has 0 utility). Just making sure that you got that right. If not, perhaps use b1.dummy[0.3|-0.1|0.1] * A_car[1,2,3,0].

Code: Select all
design
;alts = service1* , service2*
;rows = 60
;block = 5
;alg = mfederov
;eff = (mnl,d)
;reject:
service1.Birth_place=2 and service1.Duration=0,
service1.Birth_place=2 and service1.Duration=1,
service1.Birth_place=2 and service1.Duration=2,

service2.Birth_place=2 and service2.Duration=0,
service2.Birth_place=2 and service2.Duration=1,
service2.Birth_place=2 and service2.Duration=2,

service1.Birth_place=2 and service1.SP_after_birth=0,
service1.Birth_place=2 and service1.SP_after_birth=1,
service1.Birth_place=2 and service1.SP_after_birth=2,
service1.Birth_place=2 and service1.SP_after_birth=3,
service1.Birth_place=2 and service1.SP_after_birth=4,

service2.Birth_place=2 and service2.SP_after_birth=0,
service2.Birth_place=2 and service2.SP_after_birth=1,
service2.Birth_place=2 and service2.SP_after_birth=2,
service2.Birth_place=2 and service2.SP_after_birth=3
?service2.Birth_place=2 and service2.SP_after_birth=4
;model:
U(service1) = b1.dummy[0.3|-0.1|0.1] * A_care[0,1,2,3]
+ b2.dummy[0.3|-0.1] * A_education[0,1,2]
+ b3.dummy[0.5|0.1] * Birth_place[0,1,2]
+ b4.dummy[-0.5|0.1|0.2] * Duration[0,1,2,3]
+ b5.dummy[0.2|-0.3|0.1|0.15] * SP_after_birth[0,1,2,3,4]
+ b6.dummy[0.15|-0.3|0.1] * Breastfeeding[0,1,2,3]
+ b7.dummy[0.3|-0.3|0.1] * P_care[0,1,2,3]
+ b8.dummy[0.2|0.5|0.1] * SP_outpatients[0,1,2,3]
/
U(service2) = b1 * A_care
+ b2 * A_education
+ b3 * Birth_place
+ b4 * Duration
+ b5 * SP_after_birth
+ b6 * Breastfeeding
+ b7 * P_care
+ b8 * SP_outpatients
$


The other error is likely that you forgot to remove the comma after the last constraint.

Michiel
Michiel Bliemer
 
Posts: 1733
Joined: Tue Mar 31, 2009 4:13 pm

Re: Reject command overused?

Postby atan » Tue Sep 26, 2023 11:21 am

Hi Michiel,

Thanks for the quick response. I can see how it all works now with the last constraint disabled.

In regards to aggregating the attributes, the constraints that are in place are in relation to home birth, it would not make sense for a home birth attribute level to be combined with length of stay in hospital and support people after birth as they are not limited to the same restrictions in a facility.

Is there any reference materials in the Ngene manual to your comment about "aggregate attributes into a single attribute with combinations of allowable levels". I would be interested in attempting this to ensure all constraints are in place.

And yes, thank you for making note of how I have coded the last level, it just made more sense in my brain given how I set my attribute levels.

Thanks,

Annie
atan
 
Posts: 13
Joined: Mon Sep 25, 2023 9:49 pm

Re: Reject command overused?

Postby Michiel Bliemer » Tue Sep 26, 2023 11:32 am

Aggregating attributes has to do with the formulation of your utility functions and is not Ngene-specific.

For example, I could aggregate the birthplace and duration into a single attribute birthplace_duration with the following levels:
0 = at home
1 = in hospital for 1 day
2 = in hospital for 2 days
3 = in hospital for 3 days

This avoids that you have to link "at home" with a "0 day duration", since you cannot estimate separate utilities for these effects since they always appear together.

Another way to do it is via an interaction effect, for example:
birthplace[0,1]
0 = at home
1 = at hospital
duration[1,2,3]
1 = 1 day in hospital
2 = 2 days in hospital
3 = 3 days in hospital

Then in the utility function you could use:
b1 * birthplace + b2 * birthplace * duration

The second term will drop out if birthplace = 0 (at home) and will only become relevant when birthplace = 1 (at hospital).

Since you are using dummy coding, these interaction effects become a bit more complicated as you would need something like
b2a * birthplace.dummy[1] * duration.dummy[1] + b2b * birthplace.dummy[1] * duration.dummy[2]

You first need to decide what is the appropriate utility function for your study, and then I can help you putting this into Ngene.

Michiel
Michiel Bliemer
 
Posts: 1733
Joined: Tue Mar 31, 2009 4:13 pm

Re: Reject command overused?

Postby atan » Tue Sep 26, 2023 12:57 pm

Hi Michiel,

Thank you very much for the explanation. I have addressed this below and think that I may need a 3-way interaction for my utility function.

b3 Birthplace [0,1,2]
0 = in hospital
1 = in birth centre
2 = at home

b4 Duration [0,1,2,3]
0 = early discharge
1 = one night
2 = two nights
3 = extended stay

b5 Support people during and after birth [0,1,2,3,4]
0 = one always
1 = one leaves upon transfer
2 = one can be swapped
3 = two leaves upon transfer
4 = two can be swapped

Following your first recommendation I could have these new aggregates, which would result in more levels.

birthplace_duration
0 = at home
1 = in hospital and early discharge
2 = in hospital for 1 night
3 = in hospital for 2 nights
4 = in hospital for extended stay
5 = in birth centre and early discharge
6 = in birth centre for 1 night
7 = in birth centre for 2 nights
8 = in birth centre for extended stay

Which I would then create an interaction effect with SP_after birth. Such as:
b3 * birthplace_duration.dummy[1] +
b3a * birthplace_duration.dummy[1] * SP_after_birth.dummy[0]
b3b * birthplace_duration.cummy[1] * SP_after_birth.dummy[1]
etc.

Alternatively, maybe a three-way interaction effects could be used based on your comments :
b3 * birthplace.dummy[1] +
b3a * birthplace.dummy[1] * duration.dummy[0] * SP_after_birth.dummy[0] +
b3b * birthplace.dummy[1] * duration.dummy[0] * SP_after_birth.dummy[1] +
b3c * birthplace.dummy[1] * duration.dummy[0] * SP_after_birth.dummy[2] +
b3d * birthplace.dummy[1] * duration.dummy[0] * SP_after_birth.dummy[3] +
b3e * birthplace.dummy[1] * duration.dummy[0] * SP_after_birth.dummy[4] +

This is then repeated for each combination for birth centre, and combinations required for hospital. Is that assumption correct?

Any thoughts/recommendations you may have would be greatly appreciated.

Thanks,

Annie
atan
 
Posts: 13
Joined: Mon Sep 25, 2023 9:49 pm

Re: Reject command overused?

Postby Michiel Bliemer » Tue Sep 26, 2023 2:07 pm

It is difficult for me to comment on utility functions because I am not involved in the study and do not have the domain knowledge.

3-way interactions are very rare and very hard to explain. Based on your aggregation of your attributes, you seem to need the first 6 interaction effects. You need to think about the interactions with support after birth, perhaps this only interactions with birthplace, see last 8 interactions?

b3.dummy[..|..] * birthplace[0,1,2] +
i1 * birthplace.dummy[0] * duration.dummy[0] +
i2 * birthplace.dummy[0] * duration.dummy[1] +
i3 * birthplace.dummy[0] * duration.dummy[2] +
i4 * birthplace.dummy[1] * duration.dummy[0] +
i5 * birthplace.dummy[1] * duration.dummy[1] +
i6 * birthplace.dummy[1] * duration.dummy[2] +
i7 * birthplace.dummy[0] * SP_after_birth.dummy[0] +
i8 * birthplace.dummy[0] * SP_after_birth.dummy[1] +
i9 * birthplace.dummy[0] * SP_after_birth.dummy[2] +
i10 * birthplace.dummy[0] * SP_after_birth.dummy[3] +
i11 * birthplace.dummy[1] * SP_after_birth.dummy[0] +
i12 * birthplace.dummy[1] * SP_after_birth.dummy[1] +
i13 * birthplace.dummy[1] * SP_after_birth.dummy[2] +
i14 * birthplace.dummy[1] * SP_after_birth.dummy[3]

Perhaps discuss with others what your utility functions should be since this is study specific and I am not able to assist further.
Note that putting dummy variables only as interactions in the utility functions in Ngene is a bit tricky, so once you have finalised your utility functions try putting them in a script and I will assist.

Michiel
Michiel Bliemer
 
Posts: 1733
Joined: Tue Mar 31, 2009 4:13 pm

Re: Reject command overused?

Postby atan » Wed Oct 04, 2023 8:55 am

Dear Michiel,

In regards to my utility function, it has been suggested to me to incorporate N/A attribute levels for Duration and SP_after_birth and "add restriction-only applicable for home birth and put 0 utility to it". This will be applicable only for the design stage and when it comes to analysis to disregard the N/A level.
e.g. Duration[1.2.3.4.0]:
Extended stay = 1
Two nights = 2
One night = 3
Early discharge = 4
N/A = 0

All other components in the utility function remain the same, with the attribute levels re-organised to fit the standard [1,2,...,0] syntax.

1. Do you think this is a feasible solution? If so, when I assume prior values, would they be in reference to the N/A level=0, or original reference level. I have attempted really small priors (0.0001) however this blows out my sp-estimates. Would you have an alternative approach to this?
2. I am attempting to incorporate the interaction with scenarios with this utility function, but have received an error that this is incompatibile with Mfed algorithms, do you have any suggestiosn here?

This is my proposed utility function:
Code: Select all
?Attempt 15 - additional N/A levels, homebirth utility is 0 

design

;alts = service1* , service2*
;rows = 60
;block = 6
;alg = mfederov ?(candidates = explicit_partial_profiles.csv)
;eff = (mnl,d)
;reject:
service1.Birthplace=0 and service2.Birthplace=1,      ?Reject Service 1 = Homebirth and Service 2 = Hospital
service1.Birthplace=1 and service2.Birthplace=0,      ?Reject Service 1 = Hospital and Service 2 = Homebirth
service2.Birthplace=0 and service1.Birthplace=1,       ?Reject Service 2 = Homebirth and Service 1 = Hospital
service2.Birthplace=1 and service1.Birthplace=0       ?Reject Service 2 = Hospital and Service 1 = Homebirth

;require:
service1.Birthplace[0] = service1.Duration[0],
service1.Birthplace[0] = service1.SP_after_birth[0],
service2.Birthplace[0] = service2.Duration[0],
service2.Birthplace[0] = service2.SP_after_birth[0]

;model:
U(service1) = b1.dummy[0.3|0.2|0.1] * A_care[1,2,3,0]
+ b2.dummy[0.3|0.1] * A_education[1,2,0]
+ b3.dummy[0.5|0.1] * Birthplace[1,2,0]
+ b4.dummy[0.3|0.3|0.1|0.1] * Duration[1,2,3,4,0] ?assumed prior with reference to original base
+ b5.dummy[0.3|0.3|0.2|0.1|-0.1] * SP_after_birth[1,2,3,4,5,0] ?assumed prior with refernce to original base
+ b6.dummy[0.5|0.3|0.1] * Breastfeeding[1,2,3,0]
+ b7.dummy[0.3|0.3|0.1] * P_care[1,2,3,0]
+ b8.dummy[0.5|0.3|0.1] * SP_outpatients[1,2,3,0]
/
U(service2) = b1 * A_care
+ b2 * A_education
+ b3 * Birthplace
+ b4 * Duration
+ b5 * SP_after_birth
+ b6 * Breastfeeding
+ b7 * P_care
+ b8 * SP_outpatients
$



Thank you in advance,

Annie
atan
 
Posts: 13
Joined: Mon Sep 25, 2023 9:49 pm

Re: Reject command overused?

Postby Michiel Bliemer » Wed Oct 04, 2023 12:33 pm

N/A is not a real level so it cannot be used in modelling. You mention that you will only include it at the design stage and disregard it in the analysis stage, but then you are faced with the same problem again of choosing appropriate utility functions in the analysis phase. So you are merely shifting the problem to a future stage. If that is okay with you, then the design you generate can likely be used for your study, it just may not be as efficient as when using utility functions that you also use at the analysis stage.

1. You should ignore sample size (Sp) estimates with near-zero priors because they are only meaningful with sufficiently realistic priors. Sp estimates are computed based on the covariance matrix and divides by the prior value, so if your prior value is close to zero, the sample size estimates will go to infinity.

2. I do not see any scenario variables in your utility function. Maybe you tried something like "attr2[attr1]" in your utility function, which indeed would not work in the mfederov algorithm. To create scenario variables in the mfederov algorithm you need to use the ;require property, e.g:
;require: service1.attr = service2.attr
I ran your script and that works fine, so I am not exactly sure what issue you are referring to?

Michiel
Michiel Bliemer
 
Posts: 1733
Joined: Tue Mar 31, 2009 4:13 pm

Re: Reject command overused?

Postby atan » Wed Oct 04, 2023 1:47 pm

Hi Michiel,

Thanks again for the response, I had not updated my script with the scenario embedded. Like you mentioned I attempted to include children[children] which did not work.

Code: Select all
?Attempt 16 - including scenario interaction with no.of children

design

;alts = service1* , service2*
;rows = 60
;block = 6
;alg = mfederov (candidates = explicit_partial_profiles.csv)
;eff = (mnl,d)
;reject:
service1.Birthplace=0 and service2.Birthplace=1,      ?Reject Service 1 = Homebirth and Service 2 = Hospital
service1.Birthplace=1 and service2.Birthplace=0,      ?Reject Service 1 = Hospital and Service 2 = Homebirth
service2.Birthplace=0 and service1.Birthplace=1,       ?Reject Service 2 = Homebirth and Service 1 = Hospital
service2.Birthplace=1 and service1.Birthplace=0       ?Reject Service 2 = Hospital and Service 1 = Homebirth

;require:
service1.Birthplace[0] = service1.Duration[0],
service1.Birthplace[0] = service1.SP_after_birth[0],
service2.Birthplace[0] = service2.Duration[0],
service2.Birthplace[0] = service2.SP_after_birth[0]

;model:
U(service1) = b1.dummy[0.3|0.2|0.1] * A_care[1,2,3,0]
+ b2.dummy[0.3|0.1] * A_education[1,2,0]
+ b3.dummy[0.5|0.1] * Birthplace[1,2,0]
+ b4.dummy[0.3|0.3|0.1|0.1] * Duration[1,2,3,4,0] ?assumed prior with reference to original base
+ b5.dummy[0.3|0.3|0.2|0.1|-0.1] * SP_after_birth[1,2,3,4,5,0] ?assumed prior with refernce to original base
+ b6.dummy[0.5|0.3|0.1] * Breastfeeding[1,2,3,0]
+ b7.dummy[0.3|0.3|0.1] * P_care[1,2,3,0]
+ b8.dummy[0.5|0.3|0.1] * SP_outpatients[1,2,3,0]
?+ children[0.00001] * children[0,1]
/
U(service2) = b1 * A_care
+ b2 * A_education
+ b3 * Birthplace
+ b4 * Duration
+ b5 * SP_after_birth
+ b6 * Breastfeeding
+ b7 * P_care
+ b8 * SP_outpatients
?+ children * children[children]
$

?Error message - scenarios are not compatible with Mfed


Proposed scenario 1: Imagine we are in another pandemic, similar to the COVID-19 pandemic, you have just found out that you are pregnant. This is your first pregnancy, with one baby. Which health service would you choose for your care?
Proposed scenario 2: Imagine we are in another pandemic, similar to the COVID-19 pandemic, you have just found out that you are pregnant. This is your second pregnancy, with one child at home. Which health service would you choose for your care?

Would I now have to incorporate a new attribute to say "Number of children" to make use of the ;require property and include these scenarios?

Thank you for your response.

Kind regards,

Annie
atan
 
Posts: 13
Joined: Mon Sep 25, 2023 9:49 pm

Re: Reject command overused?

Postby Michiel Bliemer » Wed Oct 04, 2023 2:13 pm

Yes exactly, you define it as a new "attribute", NrChildren, and then set:
;require:
service1.NrChildren = service2.NrChildren

Since you alternatives are unlabelled, you will need to include a scenario variable as an interaction effect with one or more attributes, for example:

+ i1 * birthplace.dummy[1] * NrChildren[0,1]
+ i2 * birthplace.dummy[2] * NrChildren

Which attributes to interact with depends on how you believe the scenario will affect the sensitivity towards each attribute.

Michiel
Michiel Bliemer
 
Posts: 1733
Joined: Tue Mar 31, 2009 4:13 pm

Next

Return to Choice experiments - Ngene

Who is online

Users browsing this forum: No registered users and 41 guests