DE.fit: Fit a RAM matrix to the data using path analysis.

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Given a single RAM matrix, this function fits the model and returns the output from either OpenMx or sem.

Usage

1
2
  DE.fit(returned.model, dataset, N = 1000, openmx = FALSE,
    fix.variances = FALSE, calc.se = FALSE)

Arguments

returned.model

The model of interest, in RAM format. (A column of "From" variables, "To" variables, the number of arrows, and the starting value.)

dataset

A correlation matrix.

N

The sample sized used to estimate the correlation matrix.

openmx

logical. Should OpenMx be used to fit the model? If FALSE, the sem package is used instead. The default is FALSE since the sem package is faster.

fix.variances

logical. Should variances be fixed to one?

calc.se

Should the standard errors be calculated? Defaults to no to speed up the DE algorithm.

Details

above ~~

Value

Depending on which program is used to fit the data, either an OpenMx or an sem output.

Author(s)

Dustin Fife

See Also

DE, DE.dist

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
data(albanese)

	#### make restrictions
restrictions = matrix(c("", "Age", 0), nrow=1, byrow=TRUE)

	#### make a RAM matrix of the albanese model
alb = matrix(c("Age", "External", 1, .2,
				"Age", "Reflexive", 1, .2,
				"Age", "CPM", 1, .2,
				"CPM", "Reflexive", 1, .2,
				"CPM", "Mental", 1, .2,
				"Age", "Mental", 1,  .2), nrow=6, byrow=TRUE)
alb = data.frame(alb); names(alb) = c("From", "To", "Arrows", "Values")

model = DE.fit(returned.model=alb, dataset=albanese, N = 366, openmx=TRUE, fix.variances=TRUE)
summary(model)

dustinfife/DE documentation built on May 15, 2019, 6:03 p.m.