I'm estimating results from a choice experiment asking land managers to choose between one of two payment-for-ecosystem services contracts and status quo (no attributies). I'm using nested logit with opt out "none" in one nest and the two contracts (A and B) in the other. In a simple MNL without socioeconomics gives logical estimates, but I would assume that opting out is qualitatively different from uptake, choosing between A and B, hence the NL.
Code: Select all
apollo_beta=c(
asc_none = 0,
asc_a = 0,
asc_b = 0,
b_area = 0, # area of ELM contract
b_pay = 0, # compensation
b_fsize = 0, # farm size, varies by respondent
lambda_uptake = 1)
apollo_fixed = c("asc_a")
apollo_inputs = apollo_validateInputs()
apollo_probabilities=function(apollo_beta, apollo_inputs, functionality="estimate"){
### Attach inputs and detach after function exit
apollo_attach(apollo_beta, apollo_inputs)
on.exit(apollo_detach(apollo_beta, apollo_inputs))
### Create list of probabilities P
P = list()
# I want to know how farm size influences the effect of area on choice probability and WTA.
b_mp = b_fsize * fsize + b_area
### List of utilities: these must use the same names as in nl_settings, order is irrelevant
V = list()
V[["none"]] = asc_none * (b_fsize * fsize)
V[["A"]] = asc_a + b_fsize * fsize +
b_mp * A.area +
b_pay * A.pay +
V[["B"]] = asc_b + b_fsize * fsize +
b_mp * B.area +
b_pay * B.pay
nlNests = list(root = 1, uptake=lambda_uptake)
### Specify tree structure for NL model
nlStructure= list()
nlStructure[["root"]] = c("none","uptake")
nlStructure[["uptake"]] = c("A","B")
Thank you very much to anyone who might know!