Reject command overused?

This forum is for posts that specifically focus on Ngene.

Moderators: Andrew Collins, Michiel Bliemer, johnr

Re: Reject command overused?

Postby atan » Mon Oct 09, 2023 10:03 am

Dear Michiel,

Thank you for your assistance with my syntax in Ngene. I have attempted to add interactions with the attributes that I believe will affect sensitivity, as well as adding a few more restricions. I am receiving error messages for incompatibl elements.

Any help is greatly appreciated.

Thank you in advance,

Annie

Code: Select all

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],
service1.Nrchildren[0] = service2.Nrchildren[0],          ?Requires no. of children to be equal for each service
service1.Nrchildren[1] = service2.Nrchildren[1],
service1.Nrchildren[0] <> service1.SP_outpatients[1], ?Requires no. of children = 0, to not equal SP OP =1(to allow children)
service2.Nrchildren[0] <> service2.SP_outpatients[1]  ?Same as above

;model:
U(service1) = b1.dummy[0.3|0.2|0.1] * A_care[1,2,3,0]
+ i1 * A_care.dummy[1] * Nrchildren[0,1]
+ i2 * A_care.dummy[2] * Nrchildren[0,1]
+ i3 * A_care.dummy[3] * Nrchildren[0,1]
+ i4 * A_care.dummy[0] * Nrchildren[0,1]

+ b2.dummy[0.3|0.1] * A_education[1,2,0]
+ i5 * A_education.dummy[1] * Nrchildren[0,1]
+ i6 * A_education.dummy[2] * Nrchildren[0,1]
+ i7 * A_education.dummy[0] * Nrchildren[0,1]

+ 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
+ i8 * Duration.dummy[1] * Nrchildren[0,1]
+ i9 * Duration.dummy[2] * Nrchildren[0,1]
+ i10 * Duration.dummy[3] * Nrchildren[0,1]
+ i11 * Duration.dummy[4] * Nrchildren[0,1]

+ 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]
+i12 * Breastfeeding.dummy[1] *Nrchildren[0,1]
+i13 * Breastfeeding.dummy[2] *Nrchildren[0,1]
+i14 * Breastfeeding.dummy[3] *Nrchildren[0,1]
+i15 * Breastfeeding.dummy[0] *Nrchildren[0,1]

+ b7.dummy[0.3|0.3|0.1] * P_care[1,2,3,0]
+i16 * P_care.dummy[1] * Nrchildren[0,1]
+i17 * P_care.dummy[2] * Nrchildren[0,1]
+i18 * P_care.dummy[3] * Nrchildren[0,1]
+i19 * P_care.dummy[0] * Nrchildren[0,1]

+ b8.dummy[0.5|0.3|0.1] * SP_outpatients[1,2,3,0]
+ b9 * Nrchildren[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
+ b9 * Nrchildren
$



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

Re: Reject command overused?

Postby Michiel Bliemer » Mon Oct 09, 2023 10:27 am

These constraints are not properly defined:

;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],
service1.Nrchildren[0] = service2.Nrchildren[0], ?Requires no. of children to be equal for each service
service1.Nrchildren[1] = service2.Nrchildren[1],
service1.Nrchildren[0] <> service1.SP_outpatients[1], ?Requires no. of children = 0, to not equal SP OP =1(to allow children)
service2.Nrchildren[0] <> service2.SP_outpatients[1] ?Same as above

You can refer to service1.Birthplace but not refer to service1.Birthplace[0], which is a specific level. Require constraints are generally only used for creating scenario variables such as service1.Scenario = service2.Scenario, or to create status quo alternatives such as service.Attribute = 0 (specific level). All other constraints generally need reject constraints.

Instead of

service1.Nrchildren[0] = service2.Nrchildren[0],
service1.Nrchildren[1] = service2.Nrchildren[1]

I believe you mean

service1.Nrchildren = service2.Nrchildren

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

Re: Reject command overused?

Postby atan » Tue Oct 10, 2023 11:41 am

Dear Michiel,

Thank you for your response.

1. I have attempted to use the reject command instead of the require command for other constraints. Could I please have some guidance to see if this is correct?

Code: Select all
;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
service1.Birthplace=0 and service1.Duration>0,
service1.Birthplace=0 and service1.SP_after_birth>0,
service2.Birthplace=0 and service2.Duration>0,
service2.Birthplace=0 and service2.SP_after_birth>0,
service1.Nrchildren=0 and service2.SP_after_birth=1,  ?Reject Nr children = 0, and option for SP after birth to allow children
service2.Nrchildren=0 and service1.SP_after_birth=1


2. In regards to the output, I am receiving an undefined MNL d-error, is this because I have not defined priors for the interaction terms and attribute for Nr of children? I am also receiving invalid designs - have I imposed too many restrictions?

I am not sure how to proceed next.

Any help is greatly appreciated.

Kind regards,

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

Re: Reject command overused?

Postby Michiel Bliemer » Tue Oct 10, 2023 4:15 pm

Your constraints are in the correct Ngene format, but you will have to check yourself whether they make sense.

The Undefined D-error is because you have included non-identifiable interaction effects. With dummy coding, if you have 3 levels (say levels 0,1,2), you can only estimate coefficients for 2 levels, say for levels 1 and 2. When including interaction effects, you should only include interactions with 2 levels, for example .dummy[1] and .dummy[2], but you should NOT include .dummy[0] because this overspecifies the model and you cannot estimate the model.

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

Re: Reject command overused?

Postby atan » Thu Oct 12, 2023 2:58 pm

Hi Michiel,

I wonder if you will be able to comment on my use of your partial profile candidate set generator. I have now added the attribute for Nrchildren to act as the scenario. Should I include this scenario in the generator excel spreadsheet?

Currently I have 8 attributes, including the scenario would mean 9?

Thanks,

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

Re: Reject command overused?

Postby Michiel Bliemer » Thu Oct 12, 2023 4:12 pm

Yes that makes it 9. But scenario variables are different from attributes. You could first generate a candidate set with partial profiles using my spreadsheet for the 8 attributes. And afterwards you simply add a column with random levels for the scenario variable to this design. You could add the exact same column for each of the alternatives where the scenario variable appears.

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

Re: Reject command overused?

Postby atan » Tue Oct 17, 2023 11:23 am

Dear Michiel,

I have created the partial profile candidature set as you have suggested with the addition of attribute 9 after using the generator.

I am limiting my design to overlap three attributes and have done so after creating the original cadidature set (I have approximately 1100 combinations). After running the syntax for about 30mins - 1 hour and then looking at my output data, to do attribute level balance and dominance checks, some of the restrictions and require functions are not holding true. e.g. attribute level combinations are appearing even though they should be restricted.

Do you have any advice where I might be going wrong?

Kind regards,

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

Re: Reject command overused?

Postby Michiel Bliemer » Tue Oct 17, 2023 1:09 pm

It is hard to tell what could go wrong, but the easiest would be to apply the restrictions directly in the candidate set (in the spreadsheet) instead of inside Ngene. Including dominance checks. So that all choice tasks in the candidate set are allowable.

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

Re: Reject command overused?

Postby atan » Wed Oct 18, 2023 9:43 pm

Dear Michiel,

This is a question re:partial profile generator.

When copying the candidate set into a new spreadsheet, what is the correct way of naming the attribute levels. Currently the output is "alt1.x1", in my case would this translate to "service1.A". I am trying to determine what might be the issue with restrictions not working.

Alternatively, as suggested, deleting all the combinations in Excel prior to importing leaves me with 350 combinations. Is this enough to generate an efficient design?

Kind regards,

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

Previous

Return to Choice experiments - Ngene

Who is online

Users browsing this forum: No registered users and 27 guests