Skip to content

Commit

Permalink
FIRST COMMIT
Browse files Browse the repository at this point in the history
  • Loading branch information
agrogan1 committed Aug 15, 2024
1 parent d4259fb commit 662e892
Show file tree
Hide file tree
Showing 15 changed files with 4,252 additions and 0 deletions.
761 changes: 761 additions & 0 deletions tables-SEM/tables-SEM.html

Large diffs are not rendered by default.

66 changes: 66 additions & 0 deletions tables-SEM/tables-SEM.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
title: "Tables for `sem` in Stata"
date: "today"
author: "Andy Grogan-Kaylor"
format:
html:
toc: true
number-sections: true
theme:
light: yeti
dark: vapor
editor: source
---

# Introduction

A quick demo of making tables with `sem` in Stata.

```{r}
#| echo: false
#| output: false
library(Statamarkdown)
```

# Get Data

Data from [Multilevel Thinking](https://agrogan1.github.io/multilevel-thinking/simulated-multi-country-data.html)

```{stata, collectcode=TRUE}
use "https://github.com/agrogan1/multilevel-thinking/raw/main/simulate-and-analyze-multilevel-data/simulated_multilevel_data.dta", clear
```


# Run `sem` Model

Outcome is a function of physical punishment, parental warmth and the intervention. Physical punishment is potentially an outcome of the intervention.

```{stata, collectcode=TRUE}
sem (outcome <- physical_punishment warmth intervention) ///
(physical_punishment <- intervention) // sem model
est store M1 // store estimates from this model
```


# Make Table With `etable`

As long as the variables have variable labels, `etable` (with a few options) will automatically make a nice regression table.

```{stata, collectcode=TRUE}
etable, ///
estimates(M1) /// using these estimates
showstars showstarsnote /// show significance stars & note
showeq // show equations
```



12 changes: 12 additions & 0 deletions tables-SEM/tables-SEM_files/libs/bootstrap/bootstrap-dark.min.css

Large diffs are not rendered by default.

Loading

0 comments on commit 662e892

Please sign in to comment.