Re: [R] Statistical Power

2006-05-24 Thread Charles C. Berry
On Tue, 23 May 2006, Christopher Brown wrote:

 How can I compute a power analysis on a multi-factor within-subjects
 design?

If you are capable of installing source packages and if you know what a 
general linear hypothesis test is, you can:

download 'hpower' to your computer

http://gd.tuwien.ac.at/languages/R/src/contrib/hpower_0.1-0.tar.gz

and install it. Then

library( hpower )
?glhpwr


should get you started.






[ Part 3.28: Included Message ]


Charles C. Berry(858) 534-2098
  Dept of Family/Preventive Medicine
E mailto:[EMAIL PROTECTED]   UC San Diego
http://biostat.ucsd.edu/~cberry/ La Jolla, San Diego 92093-0717

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Statistical Power

2006-05-24 Thread Rick Bilonick
On Wed, 2006-05-24 at 09:22 -0700, Charles C. Berry wrote:
 On Tue, 23 May 2006, Christopher Brown wrote:
 
  How can I compute a power analysis on a multi-factor within-subjects
  design?
 
 If you are capable of installing source packages and if you know what a 
 general linear hypothesis test is, you can:
 
 download 'hpower' to your computer
 
   http://gd.tuwien.ac.at/languages/R/src/contrib/hpower_0.1-0.tar.gz
 
 and install it. Then
 
 library( hpower )
 ?glhpwr
 

Downloading, unzipping the package on to FC4 running R 2.3.0 gives an
error message about a bad description file when trying to install
hpower.

 R CMD INSTALL hpower

Rick B.

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Statistical Power

2006-05-24 Thread Ioannis Dimakos
On Wed, May 24, 2006 20:22, Rick Bilonick wrote:

 Downloading, unzipping the package on to FC4 running R 2.3.0 gives an
 error message about a bad description file when trying to install
 hpower.

 R CMD INSTALL hpower


Indeed, it does so on both my Ubuntu and Win XP boxes.  The problem is
that the DESCRIPTION file does not have a proper Maintainer line.  If
you simply add the line:

Maintainer: no-one [EMAIL PROTECTED]

and follow the regular procedures, it should install.  However, I am not
so sure that this is the right thing to do with regards to permissions
etc.  Anyone any advice?

Ioannis
-- 
Ioannis C. Dimakos, Ph.D.
University of Patras
Department of Elementary Education
Patras, GR-26500 GREECE
http://www.elemedu.upatras.gr/dimakos/
http://yannishome.port5.com/

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Statistical Power

2006-05-23 Thread Greg Snow
For other than the basic situations I generally use simulation to
estimate power.  Follow these basics steps:

Write a function that takes as input the things that you may want to
change in estimating power (sample size, effect size, standard
deviations, ...).  Inside the function generate random data based on the
inputs and your study design and computes the p-value that you are
interested in and returns that p-value.

Then use the function replicate or sapply to run this function a bunch
of times (I usually do about 1,000) and save the p-values in a vector.
The estimated power is then mean(outvec  0.05) (or whatever your alpha
level is).

The website: http://maven.smith.edu/~nhorton/R/ has an example of
simulating power for a mixed effects model (though it uses a loop rather
than replicate).

Hope this helps,

-- 
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
[EMAIL PROTECTED]
(801) 408-8111
 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Christopher Brown
Sent: Tuesday, May 23, 2006 9:54 AM
To: R-help@stat.math.ethz.ch
Subject: [R] Statistical Power

How can I compute a power analysis on a multi-factor within-subjects
design?

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html