Usuari:Lixiaoxu: diferència entre les revisions
Salta a la navegació
Salta a la cerca
cap resum d'edició
Cap resum de modificació |
|||
| Línia 166: | Línia 166: | ||
if (rawdata) (x); | if (rawdata) (x); | ||
</pre> | </pre> | ||
==Online calculator for critical values, cumulative probabilities, and critical noncentral parameters == | |||
=== Input === | |||
<Rform name="dncpx"> | |||
Choose a statistic: <input type="radio" name="name" value="t" checked/><math>t</math>, <input type="radio" name="name" value="chisq"/><math>\chi^2</math>, or <input type="radio" name="name" value="F"/><math>F</math> (noncentral parameter of <math>\chi^2</math> or <math>F</math> must be non-negative)<br/> | |||
noncentral parameter (''ncp'') | |||
:= <input name="ncp" type="text" size="5" maxlength="10" value="4.5"> ( vs. <input name="ncp_c" type="text" size="5" maxlength="10" value="0"> ) | |||
degree freedom | |||
:= <input name="df1" type="text" size="5" maxlength="10" value="4"> | |||
degree freedom of denominator (only for <math>F</math>) | |||
:= <input name="df2" type="text" size="5" maxlength="10" value="3"> | |||
Mark the points with cumulative probability | |||
:= <input type="input" name="q0" maxlength="10" value=".025" size="5"> | |||
and the critical statistic | |||
:= <input type="input" name="x1" maxlength="10" value="5.1" size="5"> | |||
Click to update display with precision <input type="submit" name="submit" value=".001"><input type="submit" name="submit" value=".0001"><input type="submit" name="submit" value=".000001"><input type="submit" name="submit" value="fully"> | |||
<br /> | |||
</Rform> | |||
=== Results of critical statistic, cumulative probability, and critical noncentral parameter === | |||
:[http://mars.wiwi.hu-berlin.de/mediawiki/slides/index.php/Comparison_of_noncentral_and_central_distributions#How_to_cite_this_page_in_APA_style How to cite this result] | |||
<R output="display" name="dncpx" iframe="height:400px;"> | |||
digits <- ifelse(exists("submit"),ifelse(as.character(submit)=='fully',Inf,round(log(as.numeric(submit),.1))),3) | |||
if (exists("ncp")) ncp <- as.numeric(ncp) else ncp <- 4.5 | |||
ncp_c <- ifelse(exists("ncp_c"), as.numeric(ncp_c),0); | |||
if (exists("df1")) df1 <- as.numeric(df1) else df1 <- 4 | |||
if (exists("df2")) df2 <- as.numeric(df2) else df2 <- 3 | |||
if (exists("name")) name <- as.character(name) else name <- 't' | |||
if (exists("q0")) q0 <- as.numeric(q0) else q0 <- .025 | |||
if (exists("x1")) x1 <- as.numeric(x1) else x1 <- 5.1 | |||
ncpt<-function(x,q,df,confirm=FALSE){ | |||
.f<-function(ncp,x,df,q)abs(q-pt(x,df=df,ncp=ncp)) | |||
.n<-1; | |||
while ( | |||
( | |||
(pt(x,df=df,ncp=-.n) < q+(1-q)/2 ) | |||
| | |||
(pt(x,df=df,ncp=.n) > q/2) | |||
) | |||
& | |||
(.n < Inf) | |||
) | |||
.n <- .n *2 ; | |||
if (confirm) | |||
optimize(f=.f,x=x,df=df,q=q,interval=c(-.n,.n)) | |||
else | |||
optimize(f=.f,x=x,df=df,q=q,interval=c(-.n,.n))$minimum | |||
} | |||
ncpchisq<-function(x,q,df,confirm=FALSE){ | |||
.f<-function(ncp,x,df,q)abs(q - pchisq(x,df=df,ncp=ncp)) | |||
if (pchisq(x,df=df)<=q){ | |||
if (confirm) { | |||
minimum <-0; | |||
objective <- pchisq(x,df=df)-q; | |||
data.frame(minimum,objective) | |||
}else | |||
0 | |||
}else { | |||
.n<- 1; | |||
while ( | |||
(pchisq(x,df=df,ncp=.n) > q/2) | |||
& | |||
(.n < Inf) | |||
) | |||
.n <- .n + 1; | |||
if (confirm) | |||
optimize(f=.f,x= x,df=df,q=q,interval=c(0,.n)) | |||
else | |||
optimize(f=.f,x= x,df=df,q=q,interval=c(0,.n))$minimum | |||
} | |||
}; | |||
ncpf<-function(x,q,df1,df2,confirm=FALSE){ | |||
.f<-function(ncp,x,df1,df2,q)abs(q - pf(x,df1=df1,df2=df2,ncp=ncp)) | |||
if (pf(x,df1=df1,df2=df2)<=q){ | |||
if (confirm) { | |||
minimum <-0; | |||
objective <- pf(x,df1=df1,df2=df2)-q; | |||
data.frame(minimum,objective) | |||
}else | |||
0 | |||
}else { | |||
.n<- 1; | |||
while ( | |||
(pf(x,df1=df1,df2=df2,ncp=.n) > q/2) | |||
& | |||
(.n < Inf) | |||
) | |||
.n <- .n +1 ; | |||
if (confirm) | |||
optimize(f=.f,x= x,df1=df1,df2=df2,q=q,interval=c(0,.n)) | |||
else | |||
optimize(f=.f,x= x,df1=df1,df2=df2,q=q,interval=c(0,.n))$minimum | |||
} | |||
}; | |||
d.f <- function(x,df1,df2,ncp=0) { | |||
delta <- 10^-6; | |||
(pf(x+delta,df1,df2,ncp)-pf(x-delta,df1,df2,ncp))/(2*delta) | |||
} | |||
df <- df1 | |||
if (name=='chisq'){ | |||
x <- seq(.001,ncp+df*9,length.out=500); | |||
pr <- dchisq(x,df=df,ncp=ncp); | |||
pb <- dchisq(x,df=df,ncp=ncp_c); | |||
x0 <- qchisq(q0,df=df,ncp=ncp); | |||
q1 <- pchisq(x1,df=df,ncp=ncp); | |||
ncp2 <- ncpchisq(x=x1,q=q0,df=df); | |||
pg <- dchisq(x,df=df,ncp=ncp2); | |||
q2 <- pchisq(x1,df=df,ncp=ncp2); | |||
}else if (name=='F'){ | |||
x <- seq(.001,ncp/df1+9,length.out=500); | |||
pr <- d.f(x,df1=df,df2=df2,ncp=ncp); | |||
pb <- d.f(x,df1=df,df2=df2,ncp=ncp_c); | |||
x0 <- qf(q0,df1=df1,df2=df2,ncp=ncp); | |||
q1 <- pf(x1,df1=df1,df2=df2,ncp=ncp); | |||
ncp2 <- ncpf(x=x1,q=q0,df1=df1,df2=df2); | |||
pg <- d.f(x,df1=df1,df2=df2,ncp=ncp2); | |||
q2 <- pf(x1,df1=df1,df2=df2,ncp=ncp2); | |||
}else{ | |||
x <- seq(min(ncp,ncp_c)-8,max(ncp,ncp_c)+8,length.out=500) | |||
pr <- dt(x,df=df,ncp=ncp); | |||
pb <- dt(x,df=df,ncp=ncp_c); | |||
x0 <- qt(q0,df=df,ncp=ncp); | |||
q1 <- pt(x1,df=df,ncp=ncp); | |||
ncp2 <- ncpt(x=x1,q=q0,df=df); | |||
pg <- dt(x,df=df,ncp=ncp2); | |||
q2 <- pt(x1,df=df,ncp=ncp2); | |||
} | |||
if (df <= 2) { | |||
pr[pr<=0] <- NA; | |||
pb[pb<=0] <- NA; | |||
pg[pg<=0] <- NA; | |||
pr[pr>10] <- NA; | |||
pb[pb>10] <- NA; | |||
pg[pg>10] <- NA; | |||
} | |||
x0 <- round(x0,digits); | |||
q1 <- round(q1,digits); | |||
ncp2 <- round(ncp2,digits); | |||
q2 <- round(q2,digits); | |||
pdf(rpdf, horizontal=FALSE, width=5, height=5) | |||
main <- paste('Pr(',name,'<',x0,';df=',df,',ncp=',ncp,')=',q0,'\nPr(',name,'<',x1,';df=',df,',ncp=',ncp,')=',q1,'\nPr(',name,'<',x1,';df=',df,',ncp=',ncp2,')=',q2, sep='') | |||
sub <-paste('\nnoncentral parameter = ',ncp,'(Red), ',ncp_c,'(Blue),\nand ',round(ncp2,digits),'(Black) which fits \nPr(',name,'<',x1,';ncp=',round(ncp2,digits),')=',round(q2,digits), sep='') | |||
plot(c(x,x),c(pr,pb),type='n',main=main,sub=sub,xlab='',ylab=paste(name,'probability density')) | |||
points(x[x<=max(x0,x1)],pr[x<=max(x0,x1)],col='green',type='h') | |||
points(x[x<=min(x0,x1)],pr[x<=min(x0,x1)],col='yellow',type='h') | |||
lines(x,pb,col='blue') | |||
lines(x,pr,col='red') | |||
lines(x,pg) | |||
</R> | |||
==<math>z</math> and noncentral distributions (<math>\chi^2</math>,<math>t</math>, and <math>F</math>)== | |||
===Noncentral <math>\chi^2</math>=== | |||
Let <math>Z_i</math>,''i''=0,1,2,... denote a series of independent random variables of standard normal distribution. | |||
:<math>V = \sum_{i=1}^{df}{Z_i}^2</math> | |||
will be a random variable of <math>\chi^2</math> distribution with ''df'' degrees of freedom. For any given series of constants <math>\mu_i</math>,''i''=1,2,...,''df'', | |||
:<math>\sum_{i=1}^{df}(Z_i+\mu_i)^2</math> | |||
will be a random variable of the respective noncentral <math>\chi^2</math> distribution with the same ''df'' and the distinct noncetral parameter | |||
:<math>ncp = \sum_{i=1}^{df}{\mu_i}^2</math> | |||
It is different from the random variable <math>V + ncp = \sum_{i=1}^{df}{Z_i}^2 + \sum_{i=1}^{df}{\mu_i}^2</math> of the respective central <math>\chi^2</math> distribution with a central drift. | |||
===Noncentral <math>t</math>=== | |||
For any given constant <math>\mu_0</math>, | |||
:<math> \frac{Z_0+\mu_0}{\sqrt{V/df }} =</math><math>\frac{Z_0+\mu_0}{\sqrt{\sum_{i=1}^{df}{Z_i}^2/df}}</math> | |||
is a random variable of noncentral t-distribution with noncentrality parameter | |||
:<math>ncp=\mu_0</math>, | |||
which is different from <math>\frac{Z_0}{\sqrt{V/df\ }}+\mu_0 </math>, the central t-distributed random variable drifted with the same mean. | |||
If ''df'' on this display is set to <math>\infty</math> (''Inf'' in R) and noncentral parameter set to 0, a standard normal distribution will be plotted and critical ''z'' score calculated. | |||
===Noncentral <math>F</math>=== | |||
The noncentral parameter of ''F'' is only defined on its numerator. The noncentral ''F'' distributed | |||
:<math>\frac{\sum_{i=1}^{df_1}(Z_i+\mu_i)^2/df_1}{\sum_{i=df_1+1}^{df_1+df_2}Z_i^2/df_2}</math> | |||
with noncentral parameter | |||
:ncp=<math>\sum_{i=1}^{df_1}\mu_i^2</math> | |||
is different from the central ''F'' distributed random variable plus the respective constant <math>\frac{\sum_{i=1}^{df_1}Z_i^2/df_1}{\sum_{i=df_1+1}^{df_1+df_2}Z_i^2/df_2}+\frac{\sum_{i=1}^{df_1}\mu_i^2}{df_1}</math> . | |||
== Confidence interval of standardized effect size by noncentral parameters == | |||
Confidence interval of unstandardized effect size like difference of means <math>(\mu_1-\mu_2)</math> can be found in common statistics textbooks and software, while confidence intervals of standardized effect size, especially Cohen's <math>\tilde{d}:=\frac{\mu_1-\mu_2}{\sigma}</math> and <math>\tilde{f}^2:=\frac{SS(\mu_1,\mu_2,...,\mu_K)}{K \cdot \sigma^2}</math>, rely on the calculation of confidence intervals of noncentral parameters (''ncp''). | |||
A common method to find confident interval limits of ''ncp'' is to solve the critical ''ncp'' value for marginal extreme quantile. The ''ncp'' parameter of the black curve in the above diagram could be directly adopted. For example, <math>\left(-\infty,8.968\right)</math> can be 97.5% one-way confidence interval of ''ncp'' if observed <math>t_{df=4}=5.1</math>, while change quantile from .025 to .975, we shall find that the two-way interval (1.139, 8.968) can be of 95% confidence level. | |||
=== ''T'' test for mean difference of single group or two related groups === | |||
In case of single group, ''M'' (<math>\mu</math>) denotes the sample (population) mean of single group , and ''SD'' (<math>\sigma</math>) denotes the sample (population) standard deviation. ''N'' is the sample size of the group. ''T'' test is used for the hypothesis on the difference between mean and a baseline <math>\mu_{baseline}</math>. Usually, <math>\mu_{baseline}</math> is zero, while not necessary. In case of two related groups, the single group is constructed by difference in each pair of samples, while ''SD'' (<math>\sigma</math>) denotes the sample (population) standard deviation of differences rather than within original two groups. | |||
:<math>t:=\frac{M}{SD/\sqrt{N}}=\frac{\sqrt{N}\frac{M-\mu}{\sigma} + \sqrt{N}\frac{\mu-\mu_{baseline}}{\sigma}}{\frac{SD}{\sigma}}</math> | |||
:<math>ncp=\sqrt{N}\frac{\mu-\mu_{baseline}}{\sigma}</math> and Cohen's <math>d:=\frac{M-\mu_{baseline}}{SD}</math> is the point estimate of <math>\frac{\mu-\mu_{baseline}}{\sigma}</math>. | |||
So, | |||
:<math>\tilde{d}=\frac{ncp}{\sqrt{N}}</math>. | |||
=== ''T'' test for mean difference between two independent groups === | |||
<math>n_1</math> or <math>n_2</math> is sample size within the respective group. | |||
:<math>t:=\frac{M_1-M_2}{SD_{within}/\sqrt{\frac{n_1 n_2}{n_1+n_2}}}</math>, wherein <math>SD_{within}:=\sqrt{\frac{SS_{within}}{df_{within}}}=\sqrt{\frac{(n_1-1)SD_1^2+(n_2-1)SD_2^2}{n_1+n_2-2}}</math>. | |||
:<math>ncp=\sqrt{\frac{n_1 n_2}{n_1+n_2}}\frac{\mu_1-\mu_2}{\sigma}</math> and Cohen's <math>d:=\frac{M_1-M_2}{SD_{within}}</math> is the point estimate of <math>\frac{\mu_1-\mu_2}{\sigma}</math>. | |||
So, | |||
:<math>\tilde{d}=\frac{ncp}{\sqrt{\frac{n_1 n_2}{n_1+n_2}}}</math>. | |||
=== One-way ANOVA test for mean difference across multiple independent groups === | |||
One-way ANOVA test applies noncentral F distribution. While with a given population standard deviation <math>\sigma</math>, the same test question applies noncentral chi-square distribution. | |||
:<math>F:=\frac{\frac{SS_{between}}{\sigma^{2}}/df_{between}}{\frac{SS_{within}}{\sigma^{2}}/df_{within}}</math> | |||
For each ''j''-th sample within ''i''-th group <math>X_{i,j} </math>, denote <math>M_{i}\left(X_{i,j}\right):=\frac{\sum_{w=1}^{n_{i}}X_{i,w}}{n_{i}};\;\mu_{i}\left(X_{i,j}\right):=\mu_{i};</math>. | |||
While, | |||
:<math>SS_{between} \over \sigma^{2}</math><br/> | |||
<math>= \frac{SS\left(M_{i}\left(X_{i,j}\right);i=1,2,\cdots,K,\; j=1,2,\cdots,n_{i}\right)}{\sigma^{2}}</math><br/> | |||
<math>= SS\left(\frac{M_{i}\left(X_{i,j}-\mu_{i}\right)}{\sigma}+\frac{\mu_{i}}{\sigma};i=1,2,\cdots,K,\; j=1,2,\cdots,n_{i}\right)</math><br/> | |||
<math>\sim \chi^{2}\left(df=K-1,\; ncp=SS\left(\frac{\mu_{i}\left(X_{i,j}\right)}{\sigma};i=1,2,\cdots,K,\; j=1,2,\cdots,n_{i}\right)\right)</math> | |||
So, both ''ncp''(s) of ''F'' and <math>\chi^2</math> equate | |||
:<math>SS\left(\mu_i(X_{i,j})/\sigma;i=1,2,\cdots,K,\; j=1,2,\cdots,n_{i}\right)</math>. | |||
In case of <math>n:=n_1=n_2=\cdots=n_K</math> for ''K'' independent groups of same size, the total sample size is <math>N:=n\cdot K</math>. | |||
:<math>Cohen's\;\tilde{f}{}^{2}:=\frac{SS(\mu_{1},\mu_{2},...,\mu_{K})}{K\cdot\sigma^{2}}=\frac{SS\left(\mu_i\left(X_{i,j}\right)/\sigma;i=1,2,\cdots,K,\; j=1,2,\cdots,n_{i}\right)}{n\cdot K}=\frac{ncp}{n\cdot K}=\frac{ncp}N</math>. | |||
''T''-test of pair of independent groups is a special case of one-way ANOVA. Note that noncentral parameter <math>ncp_F</math> of ''F'' is not comparable to the noncentral parameter <math>ncp_t</math> of the corresponding ''t''. Actually, <math>ncp_F=ncp_t^2</math>, and <math>\tilde{f}=\left|\frac{\tilde{d}}{2}\right|</math> in the case. | |||
=== RMSEA of Structural Equation Model === | |||
''ncp'' of <math>\chi^2</math> reported by Structural Equation Model softwares is proportional to the population value of <math>RMSEA^2</math>, or the squared distance per ''df'' from population var-cov matrix to the model space. | |||
:<math>\tilde{RMSEA}=\sqrt{\frac{ncp}{(N-1)df}}</math> | |||
== Power vs. Standardized Effect Size or ''ncp'' == | |||
===Power of ''t'' test for a given Cohen's <math>\delta</math>=== | |||
====Example of one-group mean test==== | |||
=====Input===== | |||
<Rform name="tEx"> | |||
A normally distributed population, for example, IQ distribution of students, is sampled | |||
: <math>N</math>=<Input name="N" size="3" value="16"/> | |||
times independently. The mean and standard deviation estimates from all <math>M</math> samples are respectively denoted <math>M</math> and <math>SD</math> in the current replication. | |||
The statistical interest is usually on the mean of population, named <math>\mu</math>; sometimes also on the standard deviation of population, named <math>\sigma</math>. The statistic <math>t</math> is defined as following -- | |||
:<math>t:=\frac{M-\mu_{null}}{SD/\sqrt{N}}</math> | |||
It measures whether or not <math>M</math> is significantly | |||
:<select name="direction"><option value="gt" selected>greater than</option><option value="ne" >different from</option><option value="lt">less than</option></select> a baseline :<math>\mu_{null}</math>=<input name="mu0" size="5" value="100.00"/>, | |||
relative to the scale of standard error estimate of <math>M</math>. If <math>\mu</math> is really <math>\mu_{null}</math>, the <math>t</math> statistic distribution is known with noncentral parameter 0 and degrees freedom <math>(N-1)</math>. | |||
Type I error, denoted | |||
:<math>\alpha</math>=<Input name="alpha" size="3" value=".05"/>, | |||
defines the probability domain of the extreme <math>t</math> values. | |||
However, the real <math>\mu</math> may be <math>\mu_{alternative}</math> rather than <math>\mu_{null}</math>. Then, the noncentral parameter of the <math>t</math> statistic distribution will change to be | |||
:<math>\sqrt{N}\times\frac{\mu_{alternative}-\mu_{null}}{\sigma}</math> | |||
wherein <math>\delta:=(\mu_{alternative}-\mu_{null})/\sigma</math> is estimated by Cohen's <math>d</math><math>:=(M-\mu_{null})/SD</math>. A known/hypothesized eg. | |||
:<math>\delta=</math><input name="delta" size="4" value="0.75">, | |||
together with the sample size <math>N</math>, will give a known/hypothesized noncentral <math>t</math> distribution, while a <math>\mu_{alternative}</math> alone without a given <math>\sigma</math> is helpless. | |||
Change | |||
:<math>M</math>=<Input name="M" size="5" value="105.22"/> and <math>SD</math>=<Input name="s" size="5" value="16.72" />, | |||
then verify whether they affect the statistical power. | |||
<input type="submit" value="Click to Update"/> | |||
</Rform> | |||
=====Results===== | |||
:[http://mars.wiwi.hu-berlin.de/mediawiki/slides/index.php/Comparison_of_noncentral_and_central_distributions#How_to_cite_this_page_in_APA_style How to cite this result] | |||
<R output="display" name="tEx" iframe="height:320px;"> | |||
N <- ifelse(exists("N"), as.numeric(N),16) | |||
mu0 <- ifelse(exists("mu0"), as.numeric(mu0),100) | |||
alpha <- ifelse(exists("alpha"), as.numeric(alpha),.05) | |||
delta <- ifelse(exists("delta"), as.numeric(delta),0.75) | |||
M <- ifelse(exists("M"), as.numeric(M),105.22) | |||
s <- ifelse(exists("s"), as.numeric(s),16.72) | |||
direction <- ifelse(exists("direction"), as.character(direction),"gt") | |||
ncpt<-function(x,q,df,confirm=FALSE){ | |||
if (q<=0) (+Inf) else | |||
if (q>=1) (-Inf) else | |||
if ((q>0)&(q<1)) { | |||
.f<-function(ncp,x,df,q)abs(q-pt(x,df=df,ncp=ncp)) | |||
.n<-1; | |||
while ( | |||
( | |||
(pt(x,df=df,ncp=-.n) < q+(1-q)/2 ) | |||
| | |||
(pt(x,df=df,ncp=.n) > q/2) | |||
) | |||
& | |||
(.n < Inf) | |||
) | |||
.n <- .n *2 ; | |||
if (confirm) | |||
optimize(f=.f,x=x,df=df,q=q,interval=c(-.n,.n)) | |||
else | |||
optimize(f=.f,x=x,df=df,q=q,interval=c(-.n,.n))$minimum | |||
} | |||
} | |||
pdf(rpdf, horizontal=FALSE, width=8, height=4) | |||
alpha_r <- ifelse(direction == "ne",alpha/2, ifelse(direction == "gt",alpha,0)); | |||
alpha_l <- alpha - alpha_r; | |||
se <- s/sqrt(N); | |||
df <- N-1; | |||
ncp <- sqrt(N)*delta; | |||
t <-(M-mu0)/se; | |||
tc_r <- qt(1-alpha_r,df=df); | |||
tc_l <- qt(alpha_l,df=df); | |||
d_l <- ncpt(x=t,q=1-alpha_r,df=df)/sqrt(N); | |||
d_r <- ncpt(x=t,q=alpha_l,df=df)/sqrt(N); | |||
sub <- paste("H0:blue central t; H1:red noncentral t\n",1-alpha," confidence interval of Cohen's delta\n",round(d_l,4)," ~ ",round(d_r,4),sep=""); | |||
if (direction == "ne") main1=paste("two-tail p value", round(1-pt(abs(t),df=df)+pt(-abs(t),df=df),4)); | |||
if (direction == "gt") main1=paste("right-tail p value", round(1-pt(t,df=df),4)); | |||
if (direction == "lt") main1=paste("left-tail p value", round(pt(t,df=df),4)); | |||
main1=paste("t value",round(t,4),",",main1,"\n",1-alpha,"confidence interval of mean\n",round(M+se*qt(alpha_r,df=df),4),"~",round(M-se*qt(alpha_l,df=df),4)); | |||
x <- seq(min(-4,ncp-5),max(4,ncp+5),length.out=200); | |||
op <-par(mfrow=c(1,2)); | |||
plot(x,dt(x,df=df),main=main1,sub=sub,xlab='',ylab='',type='l',col='blue'); | |||
points(x,dt(x,df=df,ncp=ncp),type='l',col='red'); | |||
x_reject <- c(x[(x > tc_r) | (x < tc_l)],tc_r,tc_l); | |||
points(x_reject,dt(x_reject,df=df,ncp=ncp),type='h',col='grey90'); | |||
points(x_reject,dt(x_reject,df=df,ncp=0),type='h',col='grey70'); | |||
points(t,dt(t,df=df,ncp=0));points(t,dt(t,df=df,ncp=0),type='h'); | |||
main2=paste("statistical power is", round(1-pt(tc_r,df=df,ncp=ncp)+pt(tc_l,df=df,ncp=ncp),4),"."); | |||
xN <- round(N/3):(3*N); | |||
plot(xN,1-pt(tc_r,df=df,ncp=sqrt(xN)*delta)+pt(tc_l,df=df,ncp=sqrt(xN)*delta),main=main2,xlab='sample size',ylab='statistical power',col='gray'); | |||
points(N,1-pt(tc_r,df=df,ncp=sqrt(N)*delta)+pt(tc_l,df=df,ncp=sqrt(N)*delta),col='red',type='h'); | |||
par(op); | |||
</R> | |||
====Two-related-group mean test==== | |||
For two-related-group case, the difference scores between each pair of samples can apply one-group mean test interface. Usually <math>\mu_{null}</math> is set to zero. | |||
===Power of <math>F</math> test for a given Cohen's <math>\tilde{f}^2</math>=== | |||
Let's use <math>\tilde{f}^2</math> denote the population of Cohen's <math>f^2</math>, specially | |||
:<math>SS(\mu_1,\mu_2,\cdots,\mu_K) \over {K\times \sigma^2}</math> | |||
in one-way ANOVA of <math>K</math> groups setup with within-group sample size ''n'' and within-group population mean <math>\mu_1,\mu_2,\cdots,\mu_K</math> respectively. The noncentral parameter of the corresponding ''F'' or <math>\chi^2</math> distribution is <math>ncp=n\times K \times \tilde{f}^2</math>. | |||
===Power of SEM close-fit test for a given RMSEA=== | |||
:<math>(N-1)\cdot df\cdot RMSEA^2+df\sim \chi^2_{df,ncp=(N-1)\cdot df\cdot Distance^2perDf(\tilde{\Sigma},Model\,Space)}</math> | |||
:<math>RMSEA=\sqrt{\frac{\hat{\chi}^2-df}{df\cdot(N-1)}}</math> | |||
==How to cite this page in APA style== | |||
In APA style this page can be cited in reference lists like -- | |||
<pre>Comparison of noncentral and central distributions. (yyyy, Month dd). In SlideWiki. Retrieved MM:SS, Month dd, yyyy, from http://mars.wiwi.hu-berlin.de/mediawiki/slides/index.php/Comparison_of_noncentral_and_central_distributions</pre> | |||
For other styles, refers to [http://en.wikipedia.org/w/index.php?title=Special:Cite&page=Effect_size&id=254066798 examples on wikipedia]. | |||
==External links== | |||
* [http://en.wikipedia.org/wiki/Noncentral_t-distribution Noncentral ''t''-distribution] on Wikipedia | |||
* [http://en.wikipedia.org/wiki/Noncentral_chi-square_distribution Noncentral <math>\chi^2</math> distribution] on Wikipedia | |||
* [http://en.wikipedia.org/wiki/Noncentral_F-distribution Noncentral ''F''-distribution] on Wikipedia | |||
* [http://en.wikipedia.org/wiki/Effect_size#Confidence_interval_and_relation_to_noncentral_parameters Confidence interval of Effect Size] on Wikipedia | |||