Hi everybody,
could you please help me what is wrong with this code. the aim is from a reshaped imputed data set run the mixed separetly for cost and qaly to extract icost and iqaly and then bootstrap them for each set of imputed data sets.
mi rename total_C_over18 y1
mi rename qaly_at18month y2
mi rename total_C0_b x1
mi rename eq5d_0_b x2
mi reshape long y x , i(pid) j(type)
label values type
gen cost=type==1
set cformat %9.2f
mi query
local M = r(M)
set seed 123
forvalues i = 1/`M' {
cap program drop test
program define test, rclass
mixed y i.cost i.cost#i.group i.cost#c.x || site: || cid:group if cost == 1 & (_mi_m == `i' | (_mi_m == 0 & _mi_miss == 0)), nocons reml
return scalar icost = _b[1.cost#1.group]
mixed y i.cost i.cost#i.group i.cost#c.x || site: || cid:group if cost == 0 & (_mi_m == `i' | (_mi_m == 0 & _mi_miss == 0)), nocons reml
return scalar iqaly = _b[1.cost#1.group]
end
bootstrap bootsdiff_cost=_b[1.cost#1.group] bootsdiff_qaly=_b[1.cost#1.group], reps(20) seed(12345) saving(file`i', replace) : test `i'
}
it doesnt work.
could you please help me what is wrong with this code. the aim is from a reshaped imputed data set run the mixed separetly for cost and qaly to extract icost and iqaly and then bootstrap them for each set of imputed data sets.
mi rename total_C_over18 y1
mi rename qaly_at18month y2
mi rename total_C0_b x1
mi rename eq5d_0_b x2
mi reshape long y x , i(pid) j(type)
label values type
gen cost=type==1
set cformat %9.2f
mi query
local M = r(M)
set seed 123
forvalues i = 1/`M' {
cap program drop test
program define test, rclass
mixed y i.cost i.cost#i.group i.cost#c.x || site: || cid:group if cost == 1 & (_mi_m == `i' | (_mi_m == 0 & _mi_miss == 0)), nocons reml
return scalar icost = _b[1.cost#1.group]
mixed y i.cost i.cost#i.group i.cost#c.x || site: || cid:group if cost == 0 & (_mi_m == `i' | (_mi_m == 0 & _mi_miss == 0)), nocons reml
return scalar iqaly = _b[1.cost#1.group]
end
bootstrap bootsdiff_cost=_b[1.cost#1.group] bootsdiff_qaly=_b[1.cost#1.group], reps(20) seed(12345) saving(file`i', replace) : test `i'
}
it doesnt work.
Comment