Skip to content

Commit

Permalink
Merge pull request #368 from jhorzek/update_vignettes
Browse files Browse the repository at this point in the history
update vignettes
  • Loading branch information
jhorzek authored Jan 9, 2024
2 parents e85c15d + fab5552 commit f9e6e40
Show file tree
Hide file tree
Showing 6 changed files with 525 additions and 555 deletions.
132 changes: 66 additions & 66 deletions vignettes/Definition-Variables-and-Multi-Group-SEM.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -100,18 +100,18 @@ Let's have a look at the parameters:

```r
coef(fit)
#>
#> Tuning ||--|| Estimates
#> ------- ------- ||--|| ---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------
#> lambda alpha ||--|| l1_Pasteur l2_Pasteur l3_Pasteur v1 v2 v3 m1 m2
#> ======= ======= ||--|| ========== ========== ========== ========== ========== ========== ========== ==========
#> 0.0000 0.0000 ||--|| 0.7240 0.5610 0.8824 0.8449 1.0711 0.6108 4.9212 6.0770
#>
#>
#> ---------- -------------- -------------- --------------
#> m3 l1_Grant_White l2_Grant_White l3_Grant_White
#> ========== ============== ============== ==============
#> 2.2281 0.7088 0.5536 0.7360
#>
#> Tuning ||--|| Estimates
#> ------- ------- ||--|| ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------
#> lambda alpha ||--|| l1_Pasteur l2_Pasteur l3_Pasteur v1 v2 v3 m1 m2 m3
#> ======= ======= ||--|| ========== ========== ========== ========== ========== ========== ========== ========== ==========
#> 0.0000 0.0000 ||--|| 0.7240 0.5610 0.8824 0.8449 1.0711 0.6108 4.9212 6.0770 2.2281
#>
#>
#> -------------- -------------- --------------
#> l1_Grant_White l2_Grant_White l3_Grant_White
#> ============== ============== ==============
#> 0.7088 0.5536 0.7360
```
That's curious! There are group-specific parameters, but **only** for the parameters
where we provided group-specific names!
Expand Down Expand Up @@ -192,48 +192,48 @@ that we wanted these parameters to have exactly the same value in both models.

```r
coef(fit)
#>
#> Tuning ||--|| Estimates
#> ------- ------- ||--|| ---------- ---------- ---------- ---------- ---------- ----------- -----------
#> lambda alpha ||--|| ind60=~x2 ind60=~x3 a b c dem60~ind60 dem65~ind60
#> ======= ======= ||--|| ========== ========== ========== ========== ========== =========== ===========
#> 0.0000 0.0000 ||--|| 1.8164 1.5582 1.1879 1.1706 1.2511 1.4062 0.4696
#>
#>
#> ----------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------
#> dem65~dem60 y1~~y5 y2~~y4 y2~~y6 y3~~y7 y4~~y8 y6~~y8 x1~~x1 x2~~x2 x3~~x3
#> =========== ========== ========== ========== ========== ========== ========== ========== ========== ==========
#> 0.8755 0.5389 1.4270 2.2120 0.7425 0.3718 1.3734 0.0000 1.3895 1.2086
#>
#>
#> ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ------------
#> y1~~y1 y2~~y2 y3~~y3 y4~~y4 y5~~y5 y6~~y6 y7~~y7 y8~~y8 ind60~~ind60
#> ========== ========== ========== ========== ========== ========== ========== ========== ============
#> 1.8544 7.5981 4.9592 3.2006 2.2664 4.9911 3.6046 3.3135 0.5305
#>
#>
#> ------------ ------------ ---------- ---------- ---------- ---------- ---------- ---------- ----------
#> dem60~~dem60 dem65~~dem65 x1~1 x2~1 x3~1 y1~1 y2~1 y3~1 y4~1
#> ============ ============ ========== ========== ========== ========== ========== ========== ==========
#> 3.8021 0.2003 5.0409 5.8482 2.5445 5.4463 4.2330 6.5420 4.4295
#>
#>
#> ---------- ---------- ---------- ---------- ---------- ---------- ----------- ----------- ---------- ----------
#> y5~1 y6~1 y7~1 y8~1 visual=~x2 visual=~x3 textual=~x5 textual=~x6 speed=~x8 speed=~x9
#> ========== ========== ========== ========== ========== ========== =========== =========== ========== ==========
#> 5.1139 2.9502 6.1703 4.0150 0.2791 0.4461 1.1126 0.9221 1.1746 1.0056
#>
#>
#> ---------- ---------- ---------- ---------- ---------- ---------- -------------- ---------------- ------------
#> x4~~x4 x5~~x5 x6~~x6 x7~~x7 x8~~x8 x9~~x9 visual~~visual textual~~textual speed~~speed
#> ========== ========== ========== ========== ========== ========== ============== ================ ============
#> 0.3681 0.4434 0.3610 0.7750 0.4590 0.6025 1.3695 0.9839 0.4084
#>
#>
#> --------------- ------------- -------------- ---------- ---------- ---------- ---------- ---------- ----------
#> visual~~textual visual~~speed textual~~speed x4~1 x5~1 x6~1 x7~1 x8~1 x9~1
#> =============== ============= ============== ========== ========== ========== ========== ========== ==========
#> 0.4666 0.2615 0.1746 3.0967 4.3804 2.2186 4.2060 5.5507 5.3943
#>
#> Tuning ||--|| Estimates
#> ------- ------- ||--|| ---------- ---------- ---------- ---------- ---------- ----------- ----------- ----------- ----------
#> lambda alpha ||--|| ind60=~x2 ind60=~x3 a b c dem60~ind60 dem65~ind60 dem65~dem60 y1~~y5
#> ======= ======= ||--|| ========== ========== ========== ========== ========== =========== =========== =========== ==========
#> 0.0000 0.0000 ||--|| 1.8164 1.5582 1.1879 1.1706 1.2511 1.4062 0.4696 0.8755 0.5389
#>
#>
#> ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------
#> y2~~y4 y2~~y6 y3~~y7 y4~~y8 y6~~y8 x1~~x1 x2~~x2 x3~~x3 y1~~y1 y2~~y2 y3~~y3
#> ========== ========== ========== ========== ========== ========== ========== ========== ========== ========== ==========
#> 1.4270 2.2120 0.7425 0.3718 1.3734 0.0000 1.3895 1.2086 1.8544 7.5981 4.9592
#>
#>
#> ---------- ---------- ---------- ---------- ---------- ------------ ------------ ------------ ---------- ---------- ----------
#> y4~~y4 y5~~y5 y6~~y6 y7~~y7 y8~~y8 ind60~~ind60 dem60~~dem60 dem65~~dem65 x1~1 x2~1 x3~1
#> ========== ========== ========== ========== ========== ============ ============ ============ ========== ========== ==========
#> 3.2006 2.2664 4.9911 3.6046 3.3135 0.5305 3.8021 0.2003 5.0409 5.8482 2.5445
#>
#>
#> ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- -----------
#> y1~1 y2~1 y3~1 y4~1 y5~1 y6~1 y7~1 y8~1 visual=~x2 visual=~x3 textual=~x5
#> ========== ========== ========== ========== ========== ========== ========== ========== ========== ========== ===========
#> 5.4463 4.2330 6.5420 4.4295 5.1139 2.9502 6.1703 4.0150 0.2791 0.4461 1.1126
#>
#>
#> ----------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- --------------
#> textual=~x6 speed=~x8 speed=~x9 x4~~x4 x5~~x5 x6~~x6 x7~~x7 x8~~x8 x9~~x9 visual~~visual
#> =========== ========== ========== ========== ========== ========== ========== ========== ========== ==============
#> 0.9221 1.1746 1.0056 0.3681 0.4434 0.3610 0.7750 0.4590 0.6025 1.3695
#>
#>
#> ---------------- ------------ --------------- ------------- -------------- ---------- ---------- ---------- ----------
#> textual~~textual speed~~speed visual~~textual visual~~speed textual~~speed x4~1 x5~1 x6~1 x7~1
#> ================ ============ =============== ============= ============== ========== ========== ========== ==========
#> 0.9839 0.4084 0.4666 0.2615 0.1746 3.0967 4.3804 2.2186 4.2060
#>
#>
#> ---------- ----------
#> x8~1 x9~1
#> ========== ==========
#> 5.5507 5.3943
```

## Regularized Multi-Group Models
Expand All @@ -254,18 +254,18 @@ The coefficients can be extracted as usual:

```r
coef(fit, criterion = "AIC")
#>
#> Tuning ||--|| Estimates
#> ------- ------- ||--|| ---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------
#> lambda alpha ||--|| l1_Pasteur l2_Pasteur l3_Pasteur v1 v2 v3 m1 m2
#> ======= ======= ||--|| ========== ========== ========== ========== ========== ========== ========== ==========
#> 0.0000 1.0000 ||--|| 0.7239 0.5609 0.8826 0.8450 1.0712 0.6107 4.9212 6.0769
#>
#>
#> ---------- -------------- -------------- --------------
#> m3 l1_Grant_White l2_Grant_White l3_Grant_White
#> ========== ============== ============== ==============
#> 2.2280 0.7087 0.5536 0.7361
#>
#> Tuning ||--|| Estimates
#> ------- ------- ||--|| ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ----------
#> lambda alpha ||--|| l1_Pasteur l2_Pasteur l3_Pasteur v1 v2 v3 m1 m2 m3
#> ======= ======= ||--|| ========== ========== ========== ========== ========== ========== ========== ========== ==========
#> 0.0000 1.0000 ||--|| 0.7239 0.5609 0.8826 0.8450 1.0712 0.6107 4.9212 6.0769 2.2280
#>
#>
#> -------------- -------------- --------------
#> l1_Grant_White l2_Grant_White l3_Grant_White
#> ============== ============== ==============
#> 0.7087 0.5536 0.7361
```

### Regularizing Differences Between Parameters using **lessSEM**
Expand Down
Loading

0 comments on commit f9e6e40

Please sign in to comment.