Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


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

Re: st: Post estimation power estimations.


From   Steven Samuels <sjsamuels@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Post estimation power estimations.
Date   Mon, 17 Oct 2011 16:18:40 -0400

I apologize for the missing subject in the first version.

Lars,

You've given us little information, but I would guess  that you are seeing not a low-power phenomenon, but rather classic confounding: the original, unadjusted, group difference arose because "var1" is associated with "var2", and the distribution of "var2" differs between the two groups. If so, increasing the sample size won't help much.

*************************
sysuse auto, clear
reg mpg i.foreign
reg mpg weight i.foreign             
*************************                                     
                        b           se            t            p
----------------------------------------------------------------
No Confounder         4.945804     1.362162     3.630848     .0005254
Weight  Added        -1.650029     1.075994    -1.533493     .1295987
----------------------------------------------------------------

Plotting "var1" and the model predictions against "var2" should be helpful. If "var2" is a continuous variable, as you imply, the predictions will be two parallel lines. (You should check the linearity and no-interaction assumptions.)

To answer your question: no, the t-test logic does not apply to this power calculation, but the  post-hoc power calculation is simple:

*************CODE BEGINS*************
sysuse auto, clear
ssc install powercal

reg mpg i.foreign // no confounder

gen wt1000 = weight/1000
label var wt1000 "Weight (1,000 lb)"
reg mpg wt1000 i.foreign  //with confounder weight

scalar se = _se[1.foreign]
scalar n  = e(N)
scalar df = e(df_r)

local effects  165 200 250 300  //first is observed effect x 10
foreach d of local effects{
qui powercal pow_`d', delta(`d'/100) sdinf(sqrt(n)*se) nunit(n) tdf(df) ///
alpha(0.05)
}
format pow_* %6.3f

/* Power to detect Differences x 10 */
list pow_* in 1
**************CODE ENDS**************


On Oct 15, 2011, at 12:37 PM, Cameron McIntosh wrote:

What's the correlation between var1 and var2?

Cam



> From: lfolkestad@health.sdu.dk
> To: statalist@hsphsun2.harvard.edu
> Date: Sat, 15 Oct 2011 17:45:55 +0200
> Subject: st: Post estimation power estimations.
> 
> Evnin' list.
> 
> I have a question for you: when you do a ttest and you have no significant difference, you can estimate the group size needed for the between group differences to be significant, using SD and the differences in mean. I know this is a statistical no no - but lets save that discussion for another chain of emails.
> 
> My problem is that the between group difference is significant. When i correct for a variable, that shouldent interfere the between group difference dissaperes. 
> 
> What i've done:
> Xi: regress var1 var2 i.group
> _group_2 p=0.45
> Indicating that the Var2 adjusted var1 between group difference is no longer significant. I believe This is a power issue.
> 
> Can i aply the same logic as in ttest exemple, and if so - how to do that in Stata? 
> 
> Mvh
> Lars Folkestad
> 
> 
> *
> * 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/ 		 	   		  
*
*   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/


*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index