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]

Re: st: Power calculation for ZINB and Poisson Models


From   Nick Cox <[email protected]>
To   "[email protected]" <[email protected]>
Subject   Re: st: Power calculation for ZINB and Poisson Models
Date   Tue, 30 Apr 2013 10:39:42 +0100

My guess is that Stata is seeing

generate x = in 1

and complaining. It would see that if the macro d1 were not defined.

This could arise if you were not consistent about macro names.

d1 is d followed by the numeral "1" (one).

It is also too easy to type somewhere dl, namely d followed the letter "l".

This bites everyone some of the time.

Nick
[email protected]


On 30 April 2013 08:16, Chris Ansen <[email protected]> wrote:
> Dear all
>
> I am trying to do a power calculation with simulated data. Originally
> I wanted to do one for a zero-inflated negative binomial model,
> testing three null hypothesis as suggested by Williamson et al. "Power
> Calculations for ZIP and ZINB Models", Journal of Data Science 2007.
> It is found easily by typing the title to a Google browser. Here three
> null-hypotheses are tested:
>
> Three null-hypotheses:
> H0: lamda1 equals 0                      nbreg-part of the model
> H0: beta1 equals 0                         logistic part of the model
> H0: [beta1, lamda1] equals [0,0]      joined logistic and nbreg
>
> However I started with simulation of the simpler Poisson inspired by:
> http://www.stata-journal.com/sjpdf.html?articlenum=st0010
> and
> http://www.stata.com/support/faqs/statistics/power-by-simulation/
>
> My problem is that even though I copy the two different approaches and
> execute them - both gets stuck by the command "generate x =`d1´ in 1
> with the error message "in not found" r(111);
>
> The commands looks like this:
> args N r d1 d2 d3 b1
> drop _all
> set obs 3
> generate x =`d1´ in 1
> and continues exactly as explained in the link
>
> The other rather long approach (see link under Poisson with a loop
> within a loop) - does not work either! I am using STATA SE 11.2
>
> Both examples are copied from the two mentioned links, the only thing
> I have changed is the `var´, because they copy differently. I have
> also changed them for this mail not to be bounced from statalist.
>
> I have tried the long approach with version 7.0, 11.0 and 11.2 - so
> this is not the case.

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


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