Power Calculation Practical - PowerPoint PPT Presentation

About This Presentation
Title:

Power Calculation Practical

Description:

Power Calculation Practical. Benjamin Neale. Power Calculations Empirical ... Calculate Statistics and Perform Test. Given a, how many tests p a. Power ... – PowerPoint PPT presentation

Number of Views:117
Avg rating:3.0/5.0
Slides: 30
Provided by: benjami78
Category:

less

Transcript and Presenter's Notes

Title: Power Calculation Practical


1
Power Calculation Practical
  • Benjamin Neale

2
Power Calculations Empirical
  • Attempt to Grasp the NCP from Null
  • Simulate Data under theorized model
  • Calculate Statistics and Perform Test
  • Given a, how many tests p lt a
  • Power (hits)/(tests)

3
Practical Empirical Power 1
  • We will Simulate Data under a model online
  • We will run an ACE model, and test for C
  • We will then submit our results and Jeff will
    collate the empirical values
  • While that is being calculated, well talk about
    theoretical power calculations

4
Practical Empirical Power 2
  • First get ace.mx and rprog.R from
  • /faculty/ben/2006/power/practical/.
  • Well talk about what the R program does before
    we run it

5
Simulation of the MZs model
rGmz
rCmz






























1
.
00
1
.
00
1
.
00
1
.
00
1
.
00
1
.
00
1
.
00
1
.
00
A
C
E
A
C
E
C
C
0
.
5477
0
.
5477
E
E
A
A
0
.
4472
0
.
4472
0
.
7071
0
.
7071
MZ twin
MZ twin
1
6
Redrawn MZ model






















1
.
00
1
.
00
E
1
.
00
E
A
A
A
E
E
0
.
7071
0
.
7071
0
.
4472
0
.
4472
MZ twin
2
MZ twin
1
C
C
0
.
5477
0
.
5477
1
.
00
C
7
When we simulate
  • From a path diagram, we can simulate trait values
    from simulating each latent trait
  • These latent traits are assumed to be normal
    (µ0,s21 or ?0,?21)
  • The latent trait is then multiplied by the path
    coefficient

8
Whats a random normal
0.4
0.3
frequency)
0.2
0.1
0.0
-4
-2
0
2
4
x
9
Redrawn MZ model
Random Normal 1






















1
.
00
1
.
00
E
1
.
00
E
A
A
A
0
.
7071
E
E
0
.
7071
0
.
4472
0
.
4472
MZ twin
2
MZ twin
1
C
C
0
.
5477
0
.
5477
C
1
.
00
MZ twin 1 trait Norm1A(0.7071) MZ twin 2
trait
10
Redrawn MZ model
Random Normal 1






















1
.
00
1
.
00
E
1
.
00
E
A
A
A
E
0
.
7071
E
0
.
7071
0
.
4472
0
.
4472
MZ twin
2
MZ twin
1
C
C
0
.
5477
0
.
5477
C
1
.
00
MZ twin 1 trait Norm1A(0.7071) MZ twin 2
trait Norm1A(0.7071)
11
Redrawn MZ model






















1
.
00
1
.
00
E
1
.
00
E
A
A
A
E
E
0
.
7071
0
.
7071
0
.
4472
0
.
4472
MZ twin
2
MZ twin
1
Random Normal 2
C
C
0
.
5477
0
.
5477
C
1
.
00
MZ twin 1 trait Norm1A(0.7071)
Norm2C(0.5477) MZ twin 2 trait Norm1A(0.7071)
12
Redrawn MZ model
1
.
00






















1
.
00
E
1
.
00
E
A
A
A
E
E
0
.
7071
0
.
7071
0
.
4472
0
.
4472
MZ twin
2
MZ twin
1
Random Normal 2
C
C
0
.
5477
0
.
5477
C
1
.
00
MZ twin 1 trait Norm1A(0.7071)
Norm2C(0.5477) MZ twin 2 trait Norm1A(0.7071)
Norm2C(0.5477)
13
Redrawn MZ model






















1
.
00
1
.
00
E
1
.
00
E
A
A
A
E
E
0
.
7071
0
.
7071
0
.
4472
Random Normal 3
0
.
4472
MZ twin
2
MZ twin
1
C
C
0
.
5477
0
.
5477
C
1
.
00
MZ twin 1 trait Norm1A(0.7071)
Norm2C(0.5477) Norm3E(0.4472) MZ twin 2
trait Norm1A(0.7071) Norm2C(0.5477)
14
Redrawn MZ model
1
.
00






















1
.
00
E
1
.
00
E
A
A
A
E
E
0
.
7071
0
.
7071
0
.
4472
0
.
4472
Random Normal 4
MZ twin
2
MZ twin
1
C
C
0
.
5477
0
.
5477
C
1
.
00
MZ twin 1 trait Norm1A(0.7071)
Norm2C(0.5477) Norm3E(0.4472) MZ twin 2
trait Norm1A(0.7071) Norm2C(0.5477)
Norm4E(0.4472)
15
Simulation of the DZs model
rGmz
rCmz






























0
.
50
1
.
00
1
.
00
1
.
00
1
.
00
1
.
00
1
.
00
1
.
00
A
C
E
A
C
E
C
C
0
.
5477
0
.
5477
E
E
A
A
0
.
4472
0
.
4472
0
.
7071
0
.
7071
MZ twin
MZ twin
1
16
Redrawn DZ model
0
.
50
0
.
50
1
.
00
1
.
00
Asp
Asp
E
E
0
.
50
Asp
Asp
Aco
0
.
7071
0
.
7071
E
E
0
.
4472
0
.
4472
Aco
Aco
0
.
7071
0
.
7071
DZ twin
2
DZ twin
1
C
C
0
.
5477
0
.
5477
C
1
.
00
How many random normals will we need to supply a
trait value for both DZ twins?
17
Redrawn DZ model
0
.
50
0
.
50
1
.
00
1
.
00
Asp
Asp
E
E
0
.
50
Asp
Asp
Note s2(KX) K2s2(x) When K is a constant
hence 0.7071norm5
Aco
0
.
7071
0
.
7071
E
E
0
.
4472
0
.
4472
Aco
Aco
0
.
7071
0
.
7071
DZ twin
2
DZ twin
1
C
C
0
.
5477
0
.
5477
C
1
.
00
DZ twin 1 trait 0.7071Norm5Aco(0.7071)
0.7071Norm6Asp(0.7071)
Norm7C(0.5477) Norm8E(0.4472) DZ twin 2
trait 0.7071Norm5Aco(0.7071)
0.7071Norm9Asp(0.7071)
Norm7C(0.5477) Norm10E(0.4472)
18
Simulation conditions
  • 50 additive genetic variance
  • 30 common environment variance
  • 20 specific environment variance

19
Notes on the R program
  • When you run the R program it is essential that
    you change your working directory to where you
    saved the Mx script.
  • File menu then Change dir
  • After changing directory, load the R program.
  • A visual guide to this follows this slide

20
Picture of the menu
CHANGE DIR This is the menu item you must change
to change where the simulated data will be
placed Note you must have the R console
highlighted
21
Picture of the dialog box
Either type the path name or browse to where you
saved ACE.mx
22
Running the R script
SOURCE R CODE This is where we load the R
program that simulates data
23
Screenshot of source code selection
This is the file rprog.R for the source code
24
How do I know if it has worked?
  • If you have run the R program correctly, then the
    file sim.fun ought to be in the directory where
    your rprog.R and ACE.mx is.
  • If not, try again or raise your hand.

25
When you have finished
  • Note your likelihoods and your parameter
    estimates and complete the survey at
  • https//ibgwww.colorado.edu/phpsurveyor/index.php?
    sid4

26
Theoretical power calculations
  • Either derive the power solutions by hand (though
    this requires lots of time and more IQ points
    than I have)
  • Use Mx to setup the variance covariance structure
    and use option power to generate power levels

27
Quick note on the power calculations for Mx
  • Total sample size is reported at the end of the
    script
  • The sample size proportions for your groups are
    maintained.
  • For example if we say 50 MZ pairs and 100 DZ
    pairs, then Mx will assume 1/3 of your sample is
    MZ and 2/3 is DZ

28
Time to look at a script
  • Open power.mx, and well chat about it.
  • Quick overview of what the script does
  • Generates the variance covariance structure under
    the full model (1st half)
  • Intentionally fits the wrong model (by dropping
    the parameter of interest for power calculations)
    (2nd half)
  • Based on the number of observations that you
    supply generates power estimates.

29
Theoretical script
  • Following chatting, depending on time, here are
    some suggestions
  • Change ratio of MZ and DZ keeping same total
    sample size
  • Drop A rather than C
  • Change effect sizes for A, C, or E
Write a Comment
User Comments (0)
About PowerShow.com