Learn R Programming

gSEM (version 0.4.3.4)

path: Extract Path Coefficients

Description

Extract and display an equation of a pairwise path between two variables.

Usage

path(x, from, to, round = 3)

Arguments

x
object of class "sgSEMp1", which is the return value of function sgSEMp1().
from
character string. Name of the predictor.
to
character string. Name of the response variable.
round
a positive integer. The coefficients are rounded to this decimal place.

Value

A list of the following items: 1) model: the best fitted model, 2) model.print: a character string of the model equation and 3) coefs: Model coefficients vector.

Details

Extract the "best" model between any two variables. The model name and the model equation are printed on screen. The model coefficients, as well as the model R object are also returned.

Examples

Run this code
##' ## Load the sample acrylic data set
data(acrylic)

## Run semi-gSEM principle one
ans <- sgSEMp1(acrylic, predictor = "IrradTot", response = "YI")

## Extract relations between IrradTot and IAD2
cf <- path(ans, from = "IrradTot", to = "IAD2")
print(cf)

Run the code above in your browser using DataLab