Dear Julia Schmidt and Paul Demere,

I am currently writing my master thesis and for that I need ICC measures from Gebhardt et al. (2001), Claus and Thomas (2001), Ohlson and Juettner-Nauroth (2005) and Easton (2004), similar as Rene Honekamp 's question in post #25. Your posts helped me understand the GLS and CT calculations, and I tried to use Julia's CT code and adapt it to work with the Easton (2004) model. It gave me an output but the results and unreasonable with ICC estimates between 0.1 and 5.79 (i.e. 10% and 579%). I assume something is wrong with my boundaries but I can't figure it out (I am new to Stata).

The Easton model is defined as:

price = (feps_tv2 + rES*DPS_tv1 - feps_tv1)/(rES^2)

The code I used in Stata was (adapting Julia's CT code, unreasonable output as result):

generate icc_es=.

mata

z=J(1,1,.)

st_view(z,., "icc_es price feps_tv1 feps_tv2 DPS")

function s(x,p,f1,f2,dv) {

tf = (f2+(x*dv)-f1)/(x^2)

return(-p+tf)

}

for (i=1;i<=rows(z);i++) {

r=mm_root(icc_es=.,&s(),z[i,4]+epsilon(1),1-epsilon(1),1e-4,1000,z[i,2],z[i,3],z[i,4],z[i,5])

z[i,1]=icc_es

}

end

If you are able to provide some feedback on my code I would highly appreciate it!

Thank you in advance.

Kind regards,

Josefin

I am currently writing my master thesis and for that I need ICC measures from Gebhardt et al. (2001), Claus and Thomas (2001), Ohlson and Juettner-Nauroth (2005) and Easton (2004), similar as Rene Honekamp 's question in post #25. Your posts helped me understand the GLS and CT calculations, and I tried to use Julia's CT code and adapt it to work with the Easton (2004) model. It gave me an output but the results and unreasonable with ICC estimates between 0.1 and 5.79 (i.e. 10% and 579%). I assume something is wrong with my boundaries but I can't figure it out (I am new to Stata).

The Easton model is defined as:

price = (feps_tv2 + rES*DPS_tv1 - feps_tv1)/(rES^2)

The code I used in Stata was (adapting Julia's CT code, unreasonable output as result):

generate icc_es=.

mata

z=J(1,1,.)

st_view(z,., "icc_es price feps_tv1 feps_tv2 DPS")

function s(x,p,f1,f2,dv) {

tf = (f2+(x*dv)-f1)/(x^2)

return(-p+tf)

}

for (i=1;i<=rows(z);i++) {

r=mm_root(icc_es=.,&s(),z[i,4]+epsilon(1),1-epsilon(1),1e-4,1000,z[i,2],z[i,3],z[i,4],z[i,5])

z[i,1]=icc_es

}

end

If you are able to provide some feedback on my code I would highly appreciate it!

Thank you in advance.

Kind regards,

Josefin

## Comment