Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Error after -predict- in -apc_ie-


From   Steven Samuels <[email protected]>
To   [email protected]
Subject   st: Error after -predict- in -apc_ie-
Date   Mon, 3 Jan 2011 22:46:52 -0500

-

Wincent Ronggui Huang ([email protected]) wrote to me privately that advice that I had given in August about -predict- following - apc_ie- did not work. (-apc_ie- is the age-period-cohort "intrinsic estimation" command. It and apc_cglim ("generalized linear models with equality constraints on age-period-cohort effects") are commands in package -ap by Schulhofer-Wohl and Yang. ("net describe apc, from(http://fmwww.bc.edu/RePEc/bocode/a )".

I got mixed up and gave Wincent information about apc_cglim, not apc_ie. -predict- works after -apc_cglim-, but after -apc_ie- it raises an error. In the example do file that accompanies the package, the error message is:
". predict mu;
variable age_0 not found
r(111);"

I apologize to Wincent for my mistake. I can only suggest that he contact the authors of -apc-.

Steve



On Jan 2, 2011, at 9:55 PM, Wincent wrote:


May I ask how to use the three options. It generates an error like this,

. use "apc_example_data.dta", clear
. apc_ie death_f if age<=90,  age(age) period(year) cohort(cohort)
family(poisson) link(log)   exposure(exp_f) agefx(A) cohortfx(C)
periodfx(P)
option agefx() not allowed
r(198);

On 1 August 2010 20:24, Steve Samuels <[email protected]> wrote:

The -help- for -apc_ie-  indicates that it takes -glm- options, and
inspection of the source code reveals that it indeed calls -glm-. So
all -glm- post-estimation command should work. The answer to your
question is "yes", provided you use the agefx(), periodfx() and
cohortfx() options (not mentioned in the -help-) and keep the
generated variables. Run the second example in the accompanying do
file (net describe apc, from(http://fmwww.bc.edu/RePEc/bocode/a) and
do _not_ drop the generated variables _A* _P* and _C*. Then -predict-
should work as expected.

Steve

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index