netSEMm: network Structural Equation Modeling (netSEM)

Description Usage Arguments Details Value Examples

View source: R/netSEMm.R

Description

This function carries out netSEM

Usage

1
2
netSEMm(x, exogenous = NULL, endogenous = NULL, nlsInits = data.frame(a1 =
  1, a2 = 1, a3 = 1), str = FALSE)

Arguments

x

A dataframe. By default it considers all columns as exogenous variables, except first column which stores the system endogenous variable.

exogenous,

by defult it consideres all columns as exogenous variables except column number 1, which is the main endogenous response.

endogenous

A character string of the column name of the main endogenous OR a numeric number indexing the column of the main endogenous.

nlsInits

a data frame of initial vectors for nls. Each column corresponds to a coefficient. The data frame can be generated by the genInit() function. Each row is one initial vecotor. Currently the only nls function included is y = a + b * exp(c * x).

str

A boolean, whether or not this is a 'strength' type problem

Details

netSEM builds a network model of multiple continuous variables. Each pair of variables is tested for sensible paring relation chosen from 7 pre-selected common functional forms in linear regression settings. Adjusted R-squared is used for model selection for every pair.

P-values reported in the "res.print" field of the return list contains the P-values of estimators of linear regression coefficients. The P-values are ordered in the common order of coefficients, i.e. in the order of increasing exponents. For example, in the quadratic functional form y ~ b0 + b1x + b2x^2, the three P-values correspond two those of \hatb0, \hatb1 and \hatb2, respectively. If there are less than 3 coefficients to estimate, the extra P-value field is filled with NA's.

Value

An object of class netSEM, which is a list of the following items:

The object has two added attributes:

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
## Load the sample acrylic data set
data(acrylic)

## Run netSEM
ans <- netSEMm(acrylic)

## Subset dataset
res <- subsetData(ans,cutoff=c(0.3,0.6,0.8))

## Plot the network model with adjusted-R-squred of c(0.3,0.6,0.8)
plot(ans,res)

## Summary
summary(ans)

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

## Print three components of the result
ans$table
ans$bestModels
ans$allModels

netSEM documentation built on May 2, 2019, 6:32 a.m.