Syntax for constraints

This forum is for posts that specifically focus on Ngene.

Moderators: Andrew Collins, Michiel Bliemer, johnr

Syntax for constraints

Postby paulm » Tue May 07, 2013 3:57 am

Hi there,

I'm designing a fairly simple experiment. I wanted to build in two constraints: prohibitions between a few attributes. In particular, I wanted to prevent offer level 3 from appearing with incentive level 1 and message level 3 from appearing with offer level 1. At first, I tried this syntax:
design
;alts = respond, not
;rows = 16
;eff=(mnl,d)
;bdraws=halton(400)
;reject:
respond.offer = 3 and respond.incentive = 1,
respond.message = 3 and respond.offer = 1
;model:
u(respond) =
b0[-6] + b1.d[(u,0.3,0.4)|(u,.2,.3)|(u,.1,.2)]*message[1,2,3,4] +
b2.d[(u,-.2,.2)|(u,-.2,.2)]*offer[1,2,3] +
b3.d[(u,.2,.3)|(u,.1,.2)]*incentive[1,2,3] +
b4.d[(u,.4,.8)]*price_lock[1,2] +
b5.d[(u,.6,.9)|(u,.3,.6)]*cashback[1,2,3] +
b6.d[(u,-.2,.2)]*format[1,2] +
b7.d[(u,0,.2)]*channel[1,2]
$

But the resulting design included pairs that I thought were prohibited. That is, there were a few rows with offer = 3 and incentive = 1 and a few with message = 3 and offer = 1.

Then I tried this:
design
;alts = respond, not
;rows = 16
;eff=(mnl,d)
;bdraws=halton(400)
;reject:
respond.offer = 3 and respond.incentive = 1,
respond.message = 3 and respond.offer = 1
;cond:
if(respond.offer = 3, respond.incentive=[2,3]),
if(respond.message = 3, respond.offer=[2,3])
;model:
u(respond) =
b0[-6] + b1.d[(u,0.3,0.4)|(u,.2,.3)|(u,.1,.2)]*message[1,2,3,4] +
b2.d[(u,-.2,.2)|(u,-.2,.2)]*offer[1,2,3] +
b3.d[(u,.2,.3)|(u,.1,.2)]*incentive[1,2,3] +
b4.d[(u,.4,.8)]*price_lock[1,2] +
b5.d[(u,.6,.9)|(u,.3,.6)]*cashback[1,2,3] +
b6.d[(u,-.2,.2)]*format[1,2] +
b7.d[(u,0,.2)]*channel[1,2]
$

As far as I can tell, the ;cond statment does exactly the same thing as the ;reject statement. But this time it worked. Now the prohibited pairs are not included in the design.

My question is, what is wrong with the syntax of the ;reject statement? Why didn't that one work?

Thanks much.

Paul
paulm
 
Posts: 25
Joined: Wed Jan 09, 2013 3:51 am

Re: Syntax for constraints

Postby Michiel Bliemer » Tue May 07, 2013 6:19 am

The ;cond command works with the swapping algorithm (which is the default), but for ;require or ;reject you will need to change the algorithm to modified Federov for it to work, so add:
;alg = mfederov
(possibly with some extra arguments)
Michiel Bliemer
 
Posts: 1885
Joined: Tue Mar 31, 2009 4:13 pm

Re: Syntax for constraints

Postby paulm » Thu May 09, 2013 12:51 am

Thank you. I understand. It wasn't clear in the manual but I see where I ran into trouble.

Can I make a request for future versions that the ;reject type syntax work with more algorithms?

Thanks,
Paul
paulm
 
Posts: 25
Joined: Wed Jan 09, 2013 3:51 am

Re: Syntax for constraints

Postby Michiel Bliemer » Tue May 14, 2013 3:26 pm

Apologies if this was not clear in the manual. It does state it explicitly for the ;require command, and the ;reject command is the inverse of ;require and also needs the same Modified Federov algorithm as shown in the example. You are correct that it does not specifically state so. It does mention it in the syntax references under requirements for the ;reject command (page 233).

Note that only row-based algorithms can work with constraints. Most algorithms are column-based algorithms (like swapping algorithms), the only row-based algorithm is the Modified Federov algorithm. It is therefore not trivial to make constraints work with more algorithms (they become very inefficient). Constraints are relatively new in experimental design (at least, we are not aware of any other algorithms or software that does this), but we are currently investigating more advanced algorithms that can handle constraints more efficiently.

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 37 guests

cron