RMSEA=
Cohen's =
Cohen's =
=
* Steiger (2004, Eq. 48-51) and Smithson (2003, Eq. 5.17-5.19) used different definitions for Cohen's partial ( and partial ). This post adopted Steiger's definition divided by the total sample size , rather than by Smithson's denominator .
To view density plots
test <- 'chisq'; ##the statistic name -- 't', 'chisq', or 'f';
ncp_H0 <- 4.5;
ncp_H1 <- 0;
df <- 5; ##the df, or the 1st df of F;
df2 <- 4; ##if the statistic is F, the denominator df;
q<- .95; ##$5, the cumulative probability;
x <- 15; ##the critical statistic;
ND <- 3; ##number of decimal places, 0~7;
#####
sND=paste("%1.",ifelse(ND>=0 & ND<8,floor(ND),3),"f",sep="");
ncpt<-function(x,q,df,confirm=FALSE) ##
dfs=ifelse(test1=='f',paste(df,'/',df2,sep=''),as.character(df));
plot(rep(vx,3),c(vy,vy_H0,vy_H1),type='n',xlab=test,ylab=paste(test,'density'),
main=paste("Pr(",test,"< ",sprintf(sND,xq),"; df=",dfs,", ncp=",ncp_H0,")=",q," ",
"Pr(",test,"< ",x,"; df=",dfs,", ncp=",ncp_H0,")=",sprintf(sND,qx_H0),"(black curve)\n",
"Pr(",test,"< ",x,"; df=",dfs,", ncp=",ncp_H1,")=",sprintf(sND,qx_H1),"(blue curve, red dash)\n",
"Pr(",test,"< ",x,"; df=",dfs,", ncp=",sprintf(sND,ncp),
ifelse(round(qncp-q,ND)==0,")=",")<"),q,"(red curve, red dash)\n"));
lines(vx,vy,col='red');
lines(vx,vy_H0,col='black');
lines(vx,vy_H1,col='blue');
abline(h=0);
abline(v=x,col='red',lty=2);
abline(v=xq,col='black',lty=2);
paste("<","hr/><","br/>Result","<","h1><","font color=blue><","/font><","br/>",
"<","font color=black>Pr(",test,"< ",sprintf(sND,xq),";df=",dfs,", ncp=",ncp_H0,")=",q," <","br/> <","/font><","br/>",
"<","font color=black>Pr(",test,"< ",x,";df=",dfs,", ncp=",ncp_H0,")=",sprintf(sND,qx_H0)," <","br/> <","/font><","br/>",
"<","font color=blue>Pr(",test,"< ",x,";df=",dfs,", ncp=",ncp_H1,")=",sprintf(sND,qx_H1)," <","br/> <","/font><","br/>",
"<","font color=red>Pr(",test,"< ",x,";df=",dfs,", ncp=",sprintf(sND,ncp),")=",sprintf(sND,qncp)," <","br/> <","/font><","br/>",
"<","/h1>","<","hr/>",sep='')
Refereces:
Smithson, M. (2003). Confidence Intervals . Thousand Oaks, CA: Sage Publications.
Steiger, J. H. (2004). Beyond the F test: Effect size confidence intervals and tests of close fit in the analysis of variance and contrast analysis. Psychological Methods , 9 (2), 164-182.