Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: storing z-stats after nlcom


From   "Dan Rigby" <[email protected]>
To   [email protected]
Subject   st: storing z-stats after nlcom
Date   Mon, 26 Jan 2004 20:40:12 -0000

I have choice modelling data where people choose a food option on 
the basis of the levels of several attributes which define each option 
(price, GM, pesticide level etc).

I then estimate a conditional logit to identify how changes in 
attribute levels affect the probability of an option being chosen.

In addition, the ratio of any of the attribute coefficients to the price 
coefficient gives a partworth or a willingness to pay (WTP).  I find 
that some attributes are affected by:

(i)	age (age)
(ii)	age-squared (age2)
(iii)	a person�s attitude (pca1, a composite attitude score via PCA)

My calculation of the WTP is of the form:

gen wtp = -1 * [[ _b[grpA]+_b[grpApca1]* pca1 + _b[grpAage]*age 
+ _b[grpAage2]*age2]  /  _b[price] ]

I can test the significance of these WTPs using nlcom, if I insert 
pca1, age and age2 values, for example for someone aged 16 with 
an attitude score of 2:

nlcom -1*[[ _b[grpA]+_b[grpApca1]* 2 + _b[grpAage]*16 + 
_b[grpAage2]*16*16] / _b[price] ]

This gives a z-statistic to allow significance of the WTP to be 
determined for such an individual.

At the moment, I can only determine these significances if I insert 
example age and attitude values.

What I want to do is calculate and store this significance for each 
person, i.e. each observation, in the dataset.

Is it possible to do this calculation for every observation and store 
these z-statistic values as a new variable. This would allow me to 
replace the WTPs with a zero if the z-statistic falls below a critical 
value (2, for example). 



thanks,
dan rigby





Dr Dan Rigby
Senior Lecturer in Environmental Economics
School of Economic Studies
Manchester University
M13 9PL
0161 275 4808
http://les1.man.ac.uk/ses/

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index