Skip to content

Commit 2be76ef

Browse files
committed
tidying again
Signed-off-by: Nathaniel <NathanielF@users.noreply.github.com>
1 parent 3883712 commit 2be76ef

File tree

2 files changed

+16
-12
lines changed

2 files changed

+16
-12
lines changed

examples/case_studies/bayesian_sem_workflow.ipynb

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1752,7 +1752,7 @@
17521752
"\n",
17531753
"Bollen argues as follows:\n",
17541754
"\n",
1755-
"> As I have just explained, we cannot isolate a dependent variable from all influences but a single explanatory variable, so it is impossible to make definitive statements about causes. We replace perfect isolation with pseudo-isolation by assuming that the disturbance (i.e., the composite of all omitted determinants) is uncorrelated with the exogenous variables of an equation. - Bollen in _Structural Equations with Latent Variables_ pg45\n",
1755+
"> [...], we cannot isolate a dependent variable from all influences but a single explanatory variable, so it is impossible to make definitive statements about causes. We replace perfect isolation with pseudo-isolation by assuming that the disturbance (i.e., the composite of all omitted determinants) is uncorrelated with the exogenous variables of an equation. - Bollen in _Structural Equations with Latent Variables_ pg45\n",
17561756
"\n",
17571757
"This is a claim of conditional independence which licenses the causal interpretation of the the arrows in the below plot. The fact that the latent relations operate a higher level of abstraction makes it easier to postulate these \"clean\" direct paths between constructs. The model makes an argument - to have proprely measured the latent constructs, and isolated their variation - to support the causal claim. Criticisms of the model proceed by assessing how compelling these postulates are in the context of the fitted model.\n",
17581758
"\n",
@@ -4393,11 +4393,13 @@
43934393
"id": "adda74c2",
43944394
"metadata": {},
43954395
"source": [
4396-
"The sampler diagnostics also seem healthy. We can also pull out the indirect and direct effects. This is one of the biggest pay-offs for SEM modelling. We've done the work of assessing measurement error and building an abstraction layer of __what-we-care-about__ over the observed indicators. We've considered various structures of the inferential relationships and isolated those direct effects from undue confounding influences. \n",
4396+
"The sampler diagnostics also seem healthy.\n",
4397+
"\n",
4398+
"We can also pull out the indirect and direct effects. This is one of the biggest pay-offs for SEM modelling. We've done the work of assessing measurement error and building an abstraction layer of __what-we-care-about__ over the observed indicators. We've considered various structures of the inferential relationships and isolated those direct effects from undue confounding influences. Now we can pull out the impact of mediation and moderation.\n",
43974399
"\n",
43984400
"## Comparing Models\n",
43994401
"\n",
4400-
"Now we can pull out the impact of mediation and moderation."
4402+
"Let's first compare the model implied total effects, and the degrees of moderation between constructive and dysfunctional habits of thought on the satisfaction outcome."
44014403
]
44024404
},
44034405
{
@@ -4561,7 +4563,7 @@
45614563
"source": [
45624564
"\n",
45634565
"\n",
4564-
"Just for clarity, we'll pull together the residual plots. "
4566+
"We'll also pull together the model implied residuals on the correlation coefficients. This will help us see how whether our different model structures are consistently deriving similar stories about the data generating relationships. "
45654567
]
45664568
},
45674569
{
@@ -4607,7 +4609,7 @@
46074609
"id": "4337a785",
46084610
"metadata": {},
46094611
"source": [
4610-
"and align the parameter estimates. Here we can see that the models are substantially similar in key dimensions; the magnitude and direction of the implied effects are similar across each model. This is an important observation. It is this kind of robustness to model specification that we want to see in this kind of iterative modelling. This should give us confidence that the model is well specified and picking up on the actual relationships between these latent constructs. "
4612+
"Here we can see that the models are substantially similar in key dimensions; the magnitude and direction of the implied effects are similar across each model. This is an important observation. It is this kind of robustness to model specification that we want to see in this kind of iterative modelling. This should give us confidence that the model is well specified and picking up on the actual relationships between these latent constructs. "
46114613
]
46124614
},
46134615
{
@@ -4651,7 +4653,7 @@
46514653
"id": "e2f5f307",
46524654
"metadata": {},
46534655
"source": [
4654-
"But sensitivity analysis is one approach, we can be even more clinical in our assessment of these models. We can perform parameter recovery exercises to properly validate that our model specification can identify the structural parameters of our complex SEM architecture. "
4656+
"This kind of sensitivity analysis is one approach to model validation, we can be even more clinical in our assessment of these models. We can perform parameter recovery exercises to properly validate that our model specification can identify the structural parameters of our complex SEM architecture. "
46554657
]
46564658
},
46574659
{

examples/case_studies/bayesian_sem_workflow.myst.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,7 @@ The next expansionary move in SEM modelling is to consider the relations between
647647

648648
Bollen argues as follows:
649649

650-
> As I have just explained, we cannot isolate a dependent variable from all influences but a single explanatory variable, so it is impossible to make definitive statements about causes. We replace perfect isolation with pseudo-isolation by assuming that the disturbance (i.e., the composite of all omitted determinants) is uncorrelated with the exogenous variables of an equation. - Bollen in _Structural Equations with Latent Variables_ pg45
650+
> [...], we cannot isolate a dependent variable from all influences but a single explanatory variable, so it is impossible to make definitive statements about causes. We replace perfect isolation with pseudo-isolation by assuming that the disturbance (i.e., the composite of all omitted determinants) is uncorrelated with the exogenous variables of an equation. - Bollen in _Structural Equations with Latent Variables_ pg45
651651
652652
This is a claim of conditional independence which licenses the causal interpretation of the the arrows in the below plot. The fact that the latent relations operate a higher level of abstraction makes it easier to postulate these "clean" direct paths between constructs. The model makes an argument - to have proprely measured the latent constructs, and isolated their variation - to support the causal claim. Criticisms of the model proceed by assessing how compelling these postulates are in the context of the fitted model.
653653

@@ -938,11 +938,13 @@ The posterior predictive distribution of the model implied residuals seems compa
938938
plot_diagnostics(idata_sem_model_v3, parameters);
939939
```
940940

941-
The sampler diagnostics also seem healthy. We can also pull out the indirect and direct effects. This is one of the biggest pay-offs for SEM modelling. We've done the work of assessing measurement error and building an abstraction layer of __what-we-care-about__ over the observed indicators. We've considered various structures of the inferential relationships and isolated those direct effects from undue confounding influences.
941+
The sampler diagnostics also seem healthy.
942+
943+
We can also pull out the indirect and direct effects. This is one of the biggest pay-offs for SEM modelling. We've done the work of assessing measurement error and building an abstraction layer of __what-we-care-about__ over the observed indicators. We've considered various structures of the inferential relationships and isolated those direct effects from undue confounding influences. Now we can pull out the impact of mediation and moderation.
942944

943945
## Comparing Models
944946

945-
Now we can pull out the impact of mediation and moderation.
947+
Let's first compare the model implied total effects, and the degrees of moderation between constructive and dysfunctional habits of thought on the satisfaction outcome.
946948

947949
```{code-cell} ipython3
948950
:tags: [hide-input]
@@ -1057,7 +1059,7 @@ Even though constructive thought processes have a directly positive effect on jo
10571059

10581060

10591061

1060-
Just for clarity, we'll pull together the residual plots.
1062+
We'll also pull together the model implied residuals on the correlation coefficients. This will help us see how whether our different model structures are consistently deriving similar stories about the data generating relationships.
10611063

10621064
```{code-cell} ipython3
10631065
import seaborn as sns
@@ -1075,7 +1077,7 @@ for idata, model_name, ax in zip(idatas, model_names, axs):
10751077
ax.set_title(f"Residuals for {model_name}", fontsize=25);
10761078
```
10771079

1078-
and align the parameter estimates. Here we can see that the models are substantially similar in key dimensions; the magnitude and direction of the implied effects are similar across each model. This is an important observation. It is this kind of robustness to model specification that we want to see in this kind of iterative modelling. This should give us confidence that the model is well specified and picking up on the actual relationships between these latent constructs.
1080+
Here we can see that the models are substantially similar in key dimensions; the magnitude and direction of the implied effects are similar across each model. This is an important observation. It is this kind of robustness to model specification that we want to see in this kind of iterative modelling. This should give us confidence that the model is well specified and picking up on the actual relationships between these latent constructs.
10791081

10801082
```{code-cell} ipython3
10811083
ax = az.plot_forest(
@@ -1091,7 +1093,7 @@ ax[0].axvline(1, linestyle="--", color="grey")
10911093
ax[0].set_title("Comparing Factor Structures \n and Path Coefficients");
10921094
```
10931095

1094-
But sensitivity analysis is one approach, we can be even more clinical in our assessment of these models. We can perform parameter recovery exercises to properly validate that our model specification can identify the structural parameters of our complex SEM architecture.
1096+
This kind of sensitivity analysis is one approach to model validation, we can be even more clinical in our assessment of these models. We can perform parameter recovery exercises to properly validate that our model specification can identify the structural parameters of our complex SEM architecture.
10951097

10961098
+++
10971099

0 commit comments

Comments
 (0)