[Sem-additions-commits] r3 - in pkg: . R man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu May 14 21:40:22 CEST 2009


Author: jebyrnes
Date: 2009-05-14 21:40:22 +0200 (Thu, 14 May 2009)
New Revision: 3

Added:
   pkg/R/rmsea.power.R
   pkg/man/rmsea.power.Rd
Modified:
   pkg/ChangeLog
   pkg/DESCRIPTION
   pkg/R/add.errors.R
   pkg/man/add.errors.Rd
   pkg/man/add.to.model.Rd
   pkg/man/adjchisq.Rd
   pkg/man/aicW.Rd
   pkg/man/bs.boot.chisq.Rd
   pkg/man/combine.models.Rd
   pkg/man/delete.model.element.Rd
   pkg/man/icmethod.Rd
   pkg/man/mnormtest.Rd
   pkg/man/robust_summary.Rd
   pkg/man/sbDiff.Rd
   pkg/man/sbchisq.Rd
   pkg/man/sem.additions.Rd
Log:


Modified: pkg/ChangeLog
===================================================================
--- pkg/ChangeLog	2008-10-22 17:18:02 UTC (rev 2)
+++ pkg/ChangeLog	2009-05-14 19:40:22 UTC (rev 3)
@@ -1,3 +1,6 @@
+2009-05-12 JEB
+	- Multiple fixes to Rd files.
+	- Added rmsea power test by Joerg Evermann
 2008-09-02 JEB
 	- Error in delta_matrix fixed.  Delta matrix now largely squares with STATA output from Stas Kolenikov
 	- Added the Chi Square Difference test
@@ -6,4 +9,4 @@
 	 - Multiple bugfixes squaring new adjchisq object with older sbchisq object.
 
 2008-08-18 JEB
-	 - First version of package compiled and send out.
\ No newline at end of file
+	 - First version of package compiled and send out.

Modified: pkg/DESCRIPTION
===================================================================
--- pkg/DESCRIPTION	2008-10-22 17:18:02 UTC (rev 2)
+++ pkg/DESCRIPTION	2009-05-14 19:40:22 UTC (rev 3)
@@ -1,10 +1,10 @@
 Package: sem.additions
-Version: 0.1-03
-Date: 2008-0902
+Version: 0.1-04
+Date: 2009-0512
 Title: Additional Methods for Structural Equation Modelling
 Author: Jarrett Byrnes <byrnes at msi.ucsb.edu>
 Maintainer: Jarrett Byrnes <byrnes at msi.ucsb.edu>
-Depends: R(>= 2.7), sem, mvnormtest, sna
+Depends: R(>= 2.7), sem, mvnormtest, sna, boot
 Description: A series of methods for easier manipulation of RAM model objects, graphing tools for sem objects, and a variety of fit indices and corrections for non-normality.  
 License: GPL-3
-URL: http://convoluta.ucdavis.edu/research/sem-additions
+URL: https://r-forge.r-project.org/projects/sem-additions/

Modified: pkg/R/add.errors.R
===================================================================
--- pkg/R/add.errors.R	2008-10-22 17:18:02 UTC (rev 2)
+++ pkg/R/add.errors.R	2009-05-14 19:40:22 UTC (rev 3)
@@ -8,7 +8,7 @@
 
 
 #takes a RAM model, and spits back all of the variables that don't already have an error term
-get.vars.that.need.error<-function(model, add.exo=F){
+get.vars.that.need.error<-function(model, add.exo=FALSE){
 	
     ##First, find out what variables need an error term
 	variables<-list()
@@ -53,7 +53,7 @@
 ##
 #fills in errors, so you don't have to type all of them
 ##
-add.errors<-function(model, add.exo=F){
+add.errors<-function(model, add.exo=FALSE){
 
    #figure out what variables need error paths
    variables<-get.vars.that.need.error(model, add.exo=add.exo)

Added: pkg/R/rmsea.power.R
===================================================================
--- pkg/R/rmsea.power.R	                        (rev 0)
+++ pkg/R/rmsea.power.R	2009-05-14 19:40:22 UTC (rev 3)
@@ -0,0 +1,13 @@
+rmsea.power <- function(rmsea.ha, df, n, rmsea.h0=0.05, alpha=0.05) {
+	ncp0 <- (n-1) * df * rmsea.h0 * rmsea.h0
+	ncpa <- (n-1) * df * rmsea.ha * rmsea.ha
+	if (rmsea.h0 < rmsea.ha) {
+		cval <- qchisq(1-alpha, df, ncp0)
+		return(1-pchisq(cval, df, ncpa))
+	}
+	if (rmsea.h0 >= rmsea.ha) {
+		cval <- qchisq(alpha, df, ncp0)
+		return(pchisq(cval, df, ncpa))
+	}
+}
+

Modified: pkg/man/add.errors.Rd
===================================================================
--- pkg/man/add.errors.Rd	2008-10-22 17:18:02 UTC (rev 2)
+++ pkg/man/add.errors.Rd	2009-05-14 19:40:22 UTC (rev 3)
@@ -3,9 +3,10 @@
 \title{Add Error Variances to Endogenous Variables}
 \description{ Add errors to endogenous variables for which no error is currently defined. }
 
-\usage{add.errors(model)}
+\usage{add.errors(model, add.exo=FALSE)}
 \arguments{
   \item{model}{A model in the form of a ram object generated by \code{\link{specify.model}}}
+  \item{add.exo}{Will error be added for exogenous variables.}
 }
 
 \details{Scans through a model and determines which variables are endogenous.  Error variances are then added to these variables, and a new ram object is returned. }
@@ -16,7 +17,7 @@
 	\code{\link{specify.model}}
 }
 
-\example(
+\examples{
 
 
 #------------------------- Kerchoff/Kenney path analysis ---------------------
@@ -66,4 +67,6 @@
 
 ##compare the two models - they are the same
 model.kerch
-model.kerch2
\ No newline at end of file
+model.kerch2
+
+}
\ No newline at end of file

Modified: pkg/man/add.to.model.Rd
===================================================================
--- pkg/man/add.to.model.Rd	2008-10-22 17:18:02 UTC (rev 2)
+++ pkg/man/add.to.model.Rd	2009-05-14 19:40:22 UTC (rev 3)
@@ -20,7 +20,7 @@
 
 \examples{ 
 
-    ## Same model as in \code{\link{specify.model}}.
+    ## Same model as in \link{specify.model}.
     ## broken into two pieces
 
 model.dhp <- specify.model()

Modified: pkg/man/adjchisq.Rd
===================================================================
--- pkg/man/adjchisq.Rd	2008-10-22 17:18:02 UTC (rev 2)
+++ pkg/man/adjchisq.Rd	2009-05-14 19:40:22 UTC (rev 3)
@@ -5,7 +5,7 @@
 \title{Adjusted Chi Squared Tests for Structural Equation Models}
 \description{ Adjusted Chi Squared Tests for Structural Equation Models }
 
-\usage{summary.adjchisq(adj.obj}{print.adjchisq(adj.obj)}
+\usage{summary.adjchisq(adj.obj)}{print.adjchisq(adj.obj)}
 \arguments{
   \item{adj.obj}{An adjusted Chi Squre object from one of the several methods meant to deal with structural equations models with non-normal data.}
 }

Modified: pkg/man/aicW.Rd
===================================================================
--- pkg/man/aicW.Rd	2008-10-22 17:18:02 UTC (rev 2)
+++ pkg/man/aicW.Rd	2009-05-14 19:40:22 UTC (rev 3)
@@ -4,7 +4,7 @@
 \description{Calculates the information criterion weight table for a number of models}
 \usage{aicW(a.list, func=aicc)}
 
-\argument{
+\arguments{
 	\item{a.list}{a list of objects which can have information criterion values returned}
 	\item{func}{a function for generating information criterion values.  Defaults to \code{\link{aicc}}, the small sample corrected Akaike's Information Criterion.}
 }

Modified: pkg/man/bs.boot.chisq.Rd
===================================================================
--- pkg/man/bs.boot.chisq.Rd	2008-10-22 17:18:02 UTC (rev 2)
+++ pkg/man/bs.boot.chisq.Rd	2009-05-14 19:40:22 UTC (rev 3)
@@ -6,8 +6,7 @@
 \title{Bollen-Stine Bootstrap}
 \description{ Methods to generate and handle the Bollen-Stine Bootstrap. }
 
-\usage{bs.boot.chisq(model, model.data.frame, R=2000, maxiter=500, steptol=1e
--06, t=10, ...)
+\usage{bs.boot.chisq(model, model.data.frame, R=2000, maxiter=500, steptol=1e-06, t=10, ...)
 
 \method{summary}{bsboot}(object)
 

Modified: pkg/man/combine.models.Rd
===================================================================
--- pkg/man/combine.models.Rd	2008-10-22 17:18:02 UTC (rev 2)
+++ pkg/man/combine.models.Rd	2009-05-14 19:40:22 UTC (rev 3)
@@ -19,7 +19,7 @@
 
 \examples{ 
 
-    ## Same model as in \code{\link{specify.model}}.
+    ## Same model as in \link{specify.model}.
     ## broken into two pieces
 
 model.dhp.paths <- specify.model()
@@ -38,7 +38,7 @@
     FGenAsp  -> FOccAsp,  NA,     1
     FGenAsp  -> FEdAsp,  lam42,  NA
 
-model.dhp.error<-add.to.model(model.dhp)
+model.dhp.error<-add.to.model(model.dhp.paths)
     RGenAsp <-> RGenAsp, ps11,   NA
     FGenAsp <-> FGenAsp, ps22,   NA
     RGenAsp <-> FGenAsp, ps12,   NA

Modified: pkg/man/delete.model.element.Rd
===================================================================
--- pkg/man/delete.model.element.Rd	2008-10-22 17:18:02 UTC (rev 2)
+++ pkg/man/delete.model.element.Rd	2009-05-14 19:40:22 UTC (rev 3)
@@ -64,7 +64,7 @@
 
 
 #now make wh2 without re-entering the whole thing
-model.wh.2<-delete.model.element("Alienation71   ->  Powerless71", model.wh.2, sort.by="path")
+model.wh.2<-delete.model.element("Alienation71   ->  Powerless71", model.wh.1, sort.by="path")
 
 model.wh.2<-delete.model.element("Alienation67   ->  Powerless67", model.wh.2, sort.by="path")
 

Modified: pkg/man/icmethod.Rd
===================================================================
--- pkg/man/icmethod.Rd	2008-10-22 17:18:02 UTC (rev 2)
+++ pkg/man/icmethod.Rd	2009-05-14 19:40:22 UTC (rev 3)
@@ -11,8 +11,8 @@
 bic(object)
 }
 
-\argument{
-	\item{object}{An object of class \code{\link{sem}}, \code{\linkadjchisq}, or \code{\link{basboot}}}
+\arguments{
+	\item{object}{An object of class \code{\link{sem}}, \code{\linkadjchisq}, or \code{\link{bsboot}}}
 }
 
 \details{Calculates information criterion values for structural equation models.  Methods will also handle alternate objects that contain chi squared indexes for structural equation models.  The formulas for each are as follows, with X as the chi squared value, df as the model degrees of freedom, t is the number of free parameters, and N is the sample size:
@@ -33,6 +33,6 @@
 	\code{\link{sbchisq}}
 	\code{\link{adjchisq}}
 	\code{\link{bsboot}}
-	\code{\link{aicw}}
+	\code{\link{aicW}}
 }
 

Modified: pkg/man/mnormtest.Rd
===================================================================
--- pkg/man/mnormtest.Rd	2008-10-22 17:18:02 UTC (rev 2)
+++ pkg/man/mnormtest.Rd	2009-05-14 19:40:22 UTC (rev 3)
@@ -4,15 +4,13 @@
 \description{Implements Shapiro-Wilk's test for multivariate normality for matrices and data frames}
 \usage{mnormtest(a.frame)}
 
-\argument{
+\arguments{
 	\item{a.frame}{A data frame containing only the data of interest}
 }
 
 \details{Provides an easy interface for assessing the multivariate normality of a single data frame using the Multivariate Shapiro-Wilk's test with \code{\link{mshapiro.test}}
 }
 
-\value{}
-
 \seealso{
 	\code{\link{mshapiro.test}}
 }

Added: pkg/man/rmsea.power.Rd
===================================================================
--- pkg/man/rmsea.power.Rd	                        (rev 0)
+++ pkg/man/rmsea.power.Rd	2009-05-14 19:40:22 UTC (rev 3)
@@ -0,0 +1,43 @@
+\name{rmsea.power}
+\alias{rmsea.power}
+\title{RMSEA Power Calculation}
+
+\description{Calculate the power for testing RMSEA based on MacCallum, Browne
+and Sugawara (1996)}
+
+\usage{rmsea.power(rmsea.ha, df, n, rmsea.h0=0.05, alpha=0.05)}
+
+\argument{
+ \item{rmsea.ha}{The RMSEA of the alternate hypothesis}
+ \item{df}{The degrees of freedom of the sem model}
+ \item{n}{Sample size}
+ \item{rmsea.h0}{The RMSEA of the Null hypothesis. MacCallum et al. (1996)
+ recommend this set to .05 as typically models are not expected to fit perfectly
+ and .05 is an accepted critical value in the literature for a good model.}
+ \item{alpha}{The type I error probability}
+}
+
+\detail{MacCallum et al. (1996) provide power and sample size calculations for
+the RMSEA fit statistic for covariance structures, based on the Chi square
+distribution. This function is based on their SAS code provided in the paper.
+MacCallum et al. (1996) suggest three typical and meaningful tests:
+
+\itemize{
+\item{Test of close fit: rmsea.ha = 0.08, rmsea.h0 = 0.05}
+\item{Test of not-close fit: rmsea.ha = 0.01, rmsea.h0 = 0.05}
+\item{Test of exact fit: rmsea.ha = 0.05, rmsea.h0 = 0.00}
+}
+}
+
+\value{The power of the test.}
+
+\author{Joerg Evermann}\email{jevermann at mun.ca}
+
+\sealso{\code{\link{sem}}}
+
+\references{
+MacCallum, R.C.; Browne, M.W. and Sugawara, H.M. 1996. Power analysis and
+determination of sample size for covariance structure modeling.
+\emph{Psychological Methods}. 1:130-149.
+}
+

Modified: pkg/man/robust_summary.Rd
===================================================================
--- pkg/man/robust_summary.Rd	2008-10-22 17:18:02 UTC (rev 2)
+++ pkg/man/robust_summary.Rd	2009-05-14 19:40:22 UTC (rev 3)
@@ -3,12 +3,12 @@
 \title{Robust Summary}
 \description{ I needed to write more code to make working with sem easier. }
 
-\usage{robust_summary(sem.obj, adj.obj=NA, data.obj=NA)}
+\usage{robust_summary(sem.obj, adj.obj=NA, data.obj=NA, useFit = F)}
 \arguments{
  \item{sem.obj}{A fitted \code{\link{sem}} object.}
   \item{adj.obj}{An \code{\link{adjchisq}} adjusted chi squared object fit using \code{\link{sbchisq}}, or, NA if you wish to have the Satorra-Bentler Chi Squared value calculated}
   \item{data.obj}{If no adjusted chi squared object is provided, a data from from which to calculate the Satorra-Bentler Chi Squared index and its associated matrices.}
-    \item{useFit}{Use the observed or fitted covariance matrix for calculation of the maximum liklihood weight matrix.  Defaults to False.}
+  \item{useFit}{Use the observed or fitted covariance matrix for calculation of the maximum liklihood weight matrix.  Defaults to False.}
 
   }
 

Modified: pkg/man/sbDiff.Rd
===================================================================
--- pkg/man/sbDiff.Rd	2008-10-22 17:18:02 UTC (rev 2)
+++ pkg/man/sbDiff.Rd	2009-05-14 19:40:22 UTC (rev 3)
@@ -5,7 +5,7 @@
 \usage{sbDiff(sbobj.A, sbobj.B)}
 
 
-\argument{
+\arguments{
 	\item{sbobj.A}{An object generated by \code{\link{sbchisq}} from an \code{\link{sem}} object}
 	\item{sbobj.B}{An object generated by \code{\link{sbchisq}} from an \code{\link{sem}} object.  sbobj.B is either a nested subset of sbobj.A or vice-versa.}
 }

Modified: pkg/man/sbchisq.Rd
===================================================================
--- pkg/man/sbchisq.Rd	2008-10-22 17:18:02 UTC (rev 2)
+++ pkg/man/sbchisq.Rd	2009-05-14 19:40:22 UTC (rev 3)
@@ -23,6 +23,8 @@
 
 \value{ An object of class \code{\link{adjchisq}}.}
 
+\author{Jarrett Byrnes}\email{byrnes at msi.ucsb.edu}
+
 \seealso{
 	\code{\link{adf.wmat}}.
 	\code{\link{ml.wmat}}.

Modified: pkg/man/sem.additions.Rd
===================================================================
--- pkg/man/sem.additions.Rd	2008-10-22 17:18:02 UTC (rev 2)
+++ pkg/man/sem.additions.Rd	2009-05-14 19:40:22 UTC (rev 3)
@@ -19,11 +19,13 @@
 	Graphical Interface for Model Specification
 	Retrospective power analysis
 	
-	Check out what is here, and if you have code contributions, please contact me at \link{byrnes at msi.ucsb.edu}
+	Check out what is here, and if you have code contributions, please contact me at \email{byrnes at msi.ucsb.edu}
 }
 
 \seealso{
   \code{\link{sem}}.
 }
 
+\author{Jarrett Byrnes}\email{byrnes at msi.ucsb.edu}
 
+



More information about the Sem-additions-commits mailing list