sgSEMp2: Semi-supervised Generalized Structural Equation Modelling...

Description Usage Arguments Details Value See Also Examples

Description

This function builds an gSEM model using gSEM principle 2. Principle 2 resembles the multiple regression principle in the way multiple predictors are considered simultaneously. Specifically, the first-level predictors to the system level variable, such as, Time and unit level variables, acted on the system level variable collectively by an additive model. This collective additive model can be found with a generalized stepwise variable selection (using the step() function in R, which performs variable selection on the basis of AIC) and this proceeds iteratively.

Usage

1
sgSEMp2(x, predictor = NULL, response = NULL)

Arguments

x

A dataframe, requiring at least 2 columns. By default its first column stores the main or primary influencing predictor, or exogenous variable e.g.., time, or a main predictor, the second column stores the response variable, and other columns store intermediate variables.

predictor

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

response

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

Details

Data is analysed first using Principle 1 to find the best models. If needed, transformations based on the best models are applied to the predictors. Starting from the system response variable, each variable is regressed on all other variables except for the system response in an additive multiple regression model, which is reduced by a stepwise selection using stepAIC(). Then, for each selected variable, fitted regression for 6 selected functional forms and pick the best.

Value

A list of the following items:

See Also

sgSEMp1() and plot.sgSEMp2()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
# Using built-in dataset
data(acrylic)
ans <- sgSEMp2(acrylic)
ans$res.print
plot(ans)

## Not run: 
# Using simulated data
x4=runif(100,0,2)
x3=1+2.5*x4+rnorm(100,0,0.5)
x1=runif(100,1,4)
x2=-1-x1+x3+rnorm(100,0,0.3)
y=2+2*exp(x1/3)+(x2-1)^2-x3+rnorm(100,0,0.5)
# Check the pairwise plot 
sim=cbind(x4,y,x1,x2,x3)
pairs(sim)
ans <- sgSEMp2(as.data.frame(sim))
plot(ans)

## End(Not run)

Example output

Working on  YI ~ IrradTot 
Working on  YI ~ IAD1 
Working on  YI ~ IAD2 
Working on  YI ~ IAD2p 
Working on  YI ~ IAD3 
Working on  IAD1 ~ IrradTot 
Working on  IAD1 ~ IAD2 
Working on  IAD1 ~ IAD2p 
Working on  IAD1 ~ IAD3 
Working on  IAD2 ~ IrradTot 
Working on  IAD2 ~ IAD1 
Working on  IAD2 ~ IAD2p 
Working on  IAD2 ~ IAD3 
Working on  IAD2p ~ IrradTot 
Working on  IAD2p ~ IAD1 
Working on  IAD2p ~ IAD2 
Working on  IAD2p ~ IAD3 
Working on  IAD3 ~ IrradTot 
Working on  IAD3 ~ IAD1 
Working on  IAD3 ~ IAD2 
Working on  IAD3 ~ IAD2p 
    resp      var  ar2 Tran
2     YI IrradTot 0.49   NA
3     YI     IAD1 0.49   NA
4     YI     IAD2 0.49   NA
5     YI    IAD2p 0.49   NA
6     YI     IAD3 0.49   NA
7   IAD1 IrradTot 0.86   NA
8   IAD1     IAD2 0.86   NA
9   IAD1    IAD2p 0.86   NA
10  IAD1     IAD3 0.86   NA
11  IAD2 IrradTot 0.99   NA
12  IAD2     IAD1 0.99   NA
13  IAD2    IAD2p 0.99   NA
14  IAD2     IAD3 0.99   NA
15 IAD2p     IAD1 0.99   NA
16 IAD2p     IAD2 0.99   NA
17 IAD2p     IAD3 0.99   NA
18  IAD3 IrradTot 0.37   NA
19  IAD3     IAD1 0.37   NA
20  IAD3     IAD2 0.37   NA
21  IAD3    IAD2p 0.37   NA
                                                                                                                             GModel
2  YI=6.5e+01+1.3e-02*IrradTot-6.2e+01*e^IAD1+8.2e+02*IAD2-1.0e+03*IAD2p+1.1e+03*IAD3+1.9e+03*IAD2^2-2.6e+03*IAD2p^2-5.3e+04*IAD3^2
3  YI=6.5e+01+1.3e-02*IrradTot-6.2e+01*e^IAD1+8.2e+02*IAD2-1.0e+03*IAD2p+1.1e+03*IAD3+1.9e+03*IAD2^2-2.6e+03*IAD2p^2-5.3e+04*IAD3^2
4  YI=6.5e+01+1.3e-02*IrradTot-6.2e+01*e^IAD1+8.2e+02*IAD2-1.0e+03*IAD2p+1.1e+03*IAD3+1.9e+03*IAD2^2-2.6e+03*IAD2p^2-5.3e+04*IAD3^2
5  YI=6.5e+01+1.3e-02*IrradTot-6.2e+01*e^IAD1+8.2e+02*IAD2-1.0e+03*IAD2p+1.1e+03*IAD3+1.9e+03*IAD2^2-2.6e+03*IAD2p^2-5.3e+04*IAD3^2
6  YI=6.5e+01+1.3e-02*IrradTot-6.2e+01*e^IAD1+8.2e+02*IAD2-1.0e+03*IAD2p+1.1e+03*IAD3+1.9e+03*IAD2^2-2.6e+03*IAD2p^2-5.3e+04*IAD3^2
7                       IAD1=-2.1e-01-3.2e-05*IrradTot+7.6e-01*exp$6.4*IAD2$-5.5e-01*exp$8.9*IAD2p$+6.3e-01*IAD3+7.8e-08*IrradTot^2
8                       IAD1=-2.1e-01-3.2e-05*IrradTot+7.6e-01*exp$6.4*IAD2$-5.5e-01*exp$8.9*IAD2p$+6.3e-01*IAD3+7.8e-08*IrradTot^2
9                       IAD1=-2.1e-01-3.2e-05*IrradTot+7.6e-01*exp$6.4*IAD2$-5.5e-01*exp$8.9*IAD2p$+6.3e-01*IAD3+7.8e-08*IrradTot^2
10                      IAD1=-2.1e-01-3.2e-05*IrradTot+7.6e-01*exp$6.4*IAD2$-5.5e-01*exp$8.9*IAD2p$+6.3e-01*IAD3+7.8e-08*IrradTot^2
11          IAD2=-1.2e-05+9.2e-06*IrradTot+1.6e-01*IAD1+1.1e+00*IAD2p-4.4e-01*IAD3-2.6e-08*IrradTot^2-5.0e-01*IAD1^2+1.7e+01*IAD3^2
12          IAD2=-1.2e-05+9.2e-06*IrradTot+1.6e-01*IAD1+1.1e+00*IAD2p-4.4e-01*IAD3-2.6e-08*IrradTot^2-5.0e-01*IAD1^2+1.7e+01*IAD3^2
13          IAD2=-1.2e-05+9.2e-06*IrradTot+1.6e-01*IAD1+1.1e+00*IAD2p-4.4e-01*IAD3-2.6e-08*IrradTot^2-5.0e-01*IAD1^2+1.7e+01*IAD3^2
14          IAD2=-1.2e-05+9.2e-06*IrradTot+1.6e-01*IAD1+1.1e+00*IAD2p-4.4e-01*IAD3-2.6e-08*IrradTot^2-5.0e-01*IAD1^2+1.7e+01*IAD3^2
15                                              IAD2p=-3.3e-04-1.3e-01*IAD1+8.9e-01*IAD2+6.9e-01*IAD3+3.4e-01*IAD1^2-2.8e+01*IAD3^2
16                                              IAD2p=-3.3e-04-1.3e-01*IAD1+8.9e-01*IAD2+6.9e-01*IAD3+3.4e-01*IAD1^2-2.8e+01*IAD3^2
17                                              IAD2p=-3.3e-04-1.3e-01*IAD1+8.9e-01*IAD2+6.9e-01*IAD3+3.4e-01*IAD1^2-2.8e+01*IAD3^2
18                                           IAD3=-1.4e-05+2.0e-06*IrradTot+1.6e-02*IAD1-1.6e-01*IAD2+2.8e-01*IAD2p+4.1e-01*IAD2p^2
19                                           IAD3=-1.4e-05+2.0e-06*IrradTot+1.6e-02*IAD1-1.6e-01*IAD2+2.8e-01*IAD2p+4.1e-01*IAD2p^2
20                                           IAD3=-1.4e-05+2.0e-06*IrradTot+1.6e-02*IAD1-1.6e-01*IAD2+2.8e-01*IAD2p+4.1e-01*IAD2p^2
21                                           IAD3=-1.4e-05+2.0e-06*IrradTot+1.6e-02*IAD1-1.6e-01*IAD2+2.8e-01*IAD2p+4.1e-01*IAD2p^2
                          Gpvalue       GR2aR2
2   0  0  0  0  0  0  0  0.003  0 0.505  0.493
3   0  0  0  0  0  0  0  0.003  0 0.505  0.493
4   0  0  0  0  0  0  0  0.003  0 0.505  0.493
5   0  0  0  0  0  0  0  0.003  0 0.505  0.493
6   0  0  0  0  0  0  0  0.003  0 0.505  0.493
7    0  0.016  0  0  0.052  0.035 0.864  0.862
8    0  0.016  0  0  0.052  0.035 0.864  0.862
9    0  0.016  0  0  0.052  0.035 0.864  0.862
10   0  0.016  0  0  0.052  0.035 0.864  0.862
11 0.912  0  0  0  0  0  0  0.003 0.993  0.993
12 0.912  0  0  0  0  0  0  0.003 0.993  0.993
13 0.912  0  0  0  0  0  0  0.003 0.993  0.993
14 0.912  0  0  0  0  0  0  0.003 0.993  0.993
15               0  0  0  0  0  0   0.99  0.99
16               0  0  0  0  0  0   0.99  0.99
17               0  0  0  0  0  0   0.99  0.99
18   0.878  0  0.072  0  0  0.005 0.383  0.374
19   0.878  0  0.072  0  0  0.005 0.383  0.374
20   0.878  0  0.072  0  0  0.005 0.383  0.374
21   0.878  0  0.072  0  0  0.005 0.383  0.374
                                              IModel             Ipvalue
2             YI=2.6+0.031*IrradTot-5e-05*IrradTot^2             0  0  0
3                                   YI=-26+30*e^IAD1            0.002  0
4                          YI=4.4+67*IAD2+432*IAD2^2         0  0  0.017
5                        YI=4.5+68*IAD2p+537*IAD2p^2     0  0.004  0.131
6                       YI=4.5+710*IAD3-31084*IAD3^2         0  0  0.001
7    IAD1=0.0047+8.8e-05*IrradTot-2.8e-07*IrradTot^2 0.005  0.009  0.003
8                           IAD1=-0.2+0.21*e^6.4IAD2             0  0  0
9                         IAD1=-0.17+0.18*e^8.9IAD2p             0  0  0
10                   IAD1=0.0068+8.5*IAD3-382*IAD3^2             0  0  0
11 IAD2=-0.00084+4.1e-05*IrradTot-1.1e-07*IrradTot^2 0.492  0.097  0.114
12                 IAD2=-0.0019+0.56*IAD1-3.1*IAD1^2             0  0  0
13                             IAD2=0.0013+1.3*IAD2p                0  0
14                  IAD2=0.00073+9.8*IAD3-459*IAD3^2         0.134  0  0
15                 IAD2p=-0.002+0.38*IAD1-2.5*IAD1^2             0  0  0
16                            IAD2p=-0.001+0.76*IAD2                0  0
17                IAD2p=-0.00046+8.1*IAD3-377*IAD3^2         0.171  0  0
18                    IAD3=-0.00014+2.4e-06*IrradTot            0.162  0
19              IAD3=-2.7e-05+0.025*IAD1-0.11*IAD1^2      0.74  0  0.024
20               IAD3=1.5e-05+0.066*IAD2+0.18*IAD2^2     0.822  0  0.021
21             IAD3=9.4e-05+0.098*IAD2p+0.43*IAD2p^2      0.15  0  0.004
         IR2aR2 Rank
2  0.335  0.331    1
3  0.038  0.035    7
4  0.049  0.044    3
5  0.027  0.021    2
6   0.065  0.06    4
7  0.029  0.023    3
8          <NA>    1
9          <NA>    2
10 0.226  0.222    5
11 0.008  0.002    5
12  0.77  0.769    2
13 0.967  0.967    1
14  0.57  0.567    6
15 0.637  0.635    2
16 0.967  0.967    1
17 0.653  0.651    3
18 0.036  0.033    2
19 0.126  0.121    5
20 0.273  0.269    3
21 0.322  0.318    1
                                                                             Gcoeff
2   6.5e+01  1.3e-02 -6.2e+01  8.2e+02 -1.0e+03  1.1e+03  1.9e+03 -2.6e+03 -5.3e+04
3   6.5e+01  1.3e-02 -6.2e+01  8.2e+02 -1.0e+03  1.1e+03  1.9e+03 -2.6e+03 -5.3e+04
4   6.5e+01  1.3e-02 -6.2e+01  8.2e+02 -1.0e+03  1.1e+03  1.9e+03 -2.6e+03 -5.3e+04
5   6.5e+01  1.3e-02 -6.2e+01  8.2e+02 -1.0e+03  1.1e+03  1.9e+03 -2.6e+03 -5.3e+04
6   6.5e+01  1.3e-02 -6.2e+01  8.2e+02 -1.0e+03  1.1e+03  1.9e+03 -2.6e+03 -5.3e+04
7                             -2.1e-01 -3.2e-05  7.6e-01 -5.5e-01  6.3e-01  7.8e-08
8                             -2.1e-01 -3.2e-05  7.6e-01 -5.5e-01  6.3e-01  7.8e-08
9                             -2.1e-01 -3.2e-05  7.6e-01 -5.5e-01  6.3e-01  7.8e-08
10                            -2.1e-01 -3.2e-05  7.6e-01 -5.5e-01  6.3e-01  7.8e-08
11          -1.2e-05  9.2e-06  1.6e-01  1.1e+00 -4.4e-01 -2.6e-08 -5.0e-01  1.7e+01
12          -1.2e-05  9.2e-06  1.6e-01  1.1e+00 -4.4e-01 -2.6e-08 -5.0e-01  1.7e+01
13          -1.2e-05  9.2e-06  1.6e-01  1.1e+00 -4.4e-01 -2.6e-08 -5.0e-01  1.7e+01
14          -1.2e-05  9.2e-06  1.6e-01  1.1e+00 -4.4e-01 -2.6e-08 -5.0e-01  1.7e+01
15                            -3.3e-04 -1.3e-01  8.9e-01  6.9e-01  3.4e-01 -2.8e+01
16                            -3.3e-04 -1.3e-01  8.9e-01  6.9e-01  3.4e-01 -2.8e+01
17                            -3.3e-04 -1.3e-01  8.9e-01  6.9e-01  3.4e-01 -2.8e+01
18                            -1.4e-05  2.0e-06  1.6e-02 -1.6e-01  2.8e-01  4.1e-01
19                            -1.4e-05  2.0e-06  1.6e-02 -1.6e-01  2.8e-01  4.1e-01
20                            -1.4e-05  2.0e-06  1.6e-02 -1.6e-01  2.8e-01  4.1e-01
21                            -1.4e-05  2.0e-06  1.6e-02 -1.6e-01  2.8e-01  4.1e-01
                                                      GModelB
2    YI=IrradTot+e^IAD1+IAD2+IAD2p+IAD3+IAD2^2+IAD2p^2+IAD3^2
3    YI=IrradTot+e^IAD1+IAD2+IAD2p+IAD3+IAD2^2+IAD2p^2+IAD3^2
4    YI=IrradTot+e^IAD1+IAD2+IAD2p+IAD3+IAD2^2+IAD2p^2+IAD3^2
5    YI=IrradTot+e^IAD1+IAD2+IAD2p+IAD3+IAD2^2+IAD2p^2+IAD3^2
6    YI=IrradTot+e^IAD1+IAD2+IAD2p+IAD3+IAD2^2+IAD2p^2+IAD3^2
7  IAD1=IrradTot+exp$6.4*IAD2$+exp$8.9*IAD2p$+IAD3+IrradTot^2
8  IAD1=IrradTot+exp$6.4*IAD2$+exp$8.9*IAD2p$+IAD3+IrradTot^2
9  IAD1=IrradTot+exp$6.4*IAD2$+exp$8.9*IAD2p$+IAD3+IrradTot^2
10 IAD1=IrradTot+exp$6.4*IAD2$+exp$8.9*IAD2p$+IAD3+IrradTot^2
11     IAD2=IrradTot+IAD1+IAD2p+IAD3+IrradTot^2+IAD1^2+IAD3^2
12     IAD2=IrradTot+IAD1+IAD2p+IAD3+IrradTot^2+IAD1^2+IAD3^2
13     IAD2=IrradTot+IAD1+IAD2p+IAD3+IrradTot^2+IAD1^2+IAD3^2
14     IAD2=IrradTot+IAD1+IAD2p+IAD3+IrradTot^2+IAD1^2+IAD3^2
15                         IAD2p=IAD1+IAD2+IAD3+IAD1^2+IAD3^2
16                         IAD2p=IAD1+IAD2+IAD3+IAD1^2+IAD3^2
17                         IAD2p=IAD1+IAD2+IAD3+IAD1^2+IAD3^2
18                      IAD3=IrradTot+IAD1+IAD2+IAD2p+IAD2p^2
19                      IAD3=IrradTot+IAD1+IAD2+IAD2p+IAD2p^2
20                      IAD3=IrradTot+IAD1+IAD2+IAD2p+IAD2p^2
21                      IAD3=IrradTot+IAD1+IAD2+IAD2p+IAD2p^2
The cutoff value is lower than all of the adjusted R-sqr values: Only solid lines
Working on  y ~ x4 
Working on  y ~ x1 
Working on  y ~ x2 
Working on  y ~ x3 
Working on  x1 ~ x4 
Working on  x1 ~ x2 
Working on  x1 ~ x3 
Working on  x2 ~ x4 
Working on  x2 ~ x1 
Working on  x2 ~ x3 
Working on  x3 ~ x4 
Working on  x3 ~ x1 
Working on  x3 ~ x2 
The cutoff value is lower than all of the adjusted R-sqr values: Only solid lines

gSEM documentation built on May 2, 2019, 11:27 a.m.

Related to sgSEMp2 in gSEM...