Skip to content

Commit

Permalink
rmarkdown::render_site(encoding = 'UTF-8')
Browse files Browse the repository at this point in the history
  • Loading branch information
remlapmot committed Mar 13, 2024
1 parent 9f83a0f commit 76cbed4
Show file tree
Hide file tree
Showing 40 changed files with 210 additions and 210 deletions.
Binary file modified data/fig1.dta
Binary file not shown.
Binary file modified data/fig2.dta
Binary file not shown.
Binary file modified data/fig3.dta
Binary file not shown.
Binary file modified data/nhefs-formatted.dta
Binary file not shown.
Binary file modified data/nhefs-highprice.dta
Binary file not shown.
Binary file modified data/nhefs-ps.dta
Binary file not shown.
Binary file modified data/nhefs-wcens.dta
Binary file not shown.
Binary file modified data/nhefs_std.dta
Binary file not shown.
Binary file modified data/nhefs_std1.dta
Binary file not shown.
Binary file modified data/nhefs_std2.dta
Binary file not shown.
Binary file modified data/nhefs_surv.dta
Binary file not shown.
Binary file modified data/observe.mmat
Binary file not shown.
18 changes: 9 additions & 9 deletions docs/13-stand-gformula-r.md
Original file line number Diff line number Diff line change
Expand Up @@ -344,14 +344,14 @@ bootstrap <-
ul
))
bootstrap
#> V1 mean se ll
#> 1 Observed 2.56188497106099 0.176543351188872 2.21586636102079
#> 2 No Treatment 1.65212306626744 0.109033982647987 1.43842038718642
#> 3 Treatment 5.11474489549336 0.341635025731429 4.44515254920234
#> 4 Treatment - No Treatment 3.46262182922592 0.249704533826002 2.97320993615059
#> V1 mean se ll
#> 1 Observed 2.56188497106099 0.0644203681453894 2.43562336962521
#> 2 No Treatment 1.65212306626744 0.0815280937014382 1.49233093888441
#> 3 Treatment 5.11474489549336 0.395339688587849 4.33989334420189
#> 4 Treatment - No Treatment 3.46262182922592 0.42570598419655 2.6282534321975
#> ul
#> 1 2.90790358110118
#> 2 1.86582574534846
#> 3 5.78433724178437
#> 4 3.95203372230125
#> 1 2.68814657249676
#> 2 1.81191519365046
#> 3 5.88959644678482
#> 4 4.29699022625433
```
18 changes: 9 additions & 9 deletions docs/15-prop-scores-r.md
Original file line number Diff line number Diff line change
Expand Up @@ -734,15 +734,15 @@ bootstrap <- data.frame(cbind(c("Observed", "No Treatment", "Treatment",
"Treatment - No Treatment"), mean, se, ll, ul))
bootstrap
#> V1 mean se ll
#> 1 Observed 2.63384609228479 0.22050900515243 2.20165638391927
#> 2 No Treatment 1.71983636149845 0.153043717988143 1.41987618618159
#> 3 Treatment 5.35072300362985 0.56340798167082 4.24646365095264
#> 4 Treatment - No Treatment 3.6308866421314 0.470096579419774 2.70951427721317
#> 1 Observed 2.63384609228479 0.271451582820604 2.10181076641002
#> 2 No Treatment 1.71983636149845 0.214947702856551 1.29854660534
#> 3 Treatment 5.35072300362985 0.611890351683222 4.15143995184319
#> 4 Treatment - No Treatment 3.6308866421314 0.54003986612722 2.57242795430622
#> ul
#> 1 3.06603580065031
#> 2 2.01979653681532
#> 3 6.45498235630706
#> 4 4.55225900704963
#> 1 3.16588141815957
#> 2 2.14112611765691
#> 3 6.55000605541652
#> 4 4.68934532995658
```


Expand Down Expand Up @@ -835,7 +835,7 @@ for(i in 1:nboot) {
}
}
#> 95% CI for the causal mean difference
#> 2.651237 , 4.46362
#> 2.507543 , 4.455503
```

A more flexible and elegant way to do this is to write a function to perform the model fitting, prediction, bootstrapping, and reporting all at once.
10 changes: 5 additions & 5 deletions docs/17-causal-surv-stata.md
Original file line number Diff line number Diff line change
Expand Up @@ -620,15 +620,15 @@ psurv1 float %9.0g psurv, interv == Duplicated observ
26. drop if newseqn != 1 /* only need one pair */
27.
r; t=0.00 14:43:06
r; t=0.00 10:56:23
Command: bootipw_surv
PrY_a0: r(boot_0)
PrY_a1: r(boot_1)
difference: r(boot_diff)
Simulations (10): .........10 done
r; t=21.89 14:43:28
r; t=19.24 10:56:42
Expand Down Expand Up @@ -855,7 +855,7 @@ meanS_t1 float %9.0g meanS_t, interv == Duplicated
observation
file /Users/tom/Documents/GitHub/cibookex-r/figs/stata-fig-17-4.png saved as PNG
file /Users/eptmp/Documents/GitHub/cibookex-r/figs/stata-fig-17-4.png saved as PNG
format
(3,132 observations deleted)
Expand All @@ -866,15 +866,15 @@ file /Users/tom/Documents/GitHub/cibookex-r/figs/stata-fig-17-4.png saved as PNG
5. drop if time != 0
6. /*only predict on new version of data */
r; t=0.00 14:43:36
r; t=0.00 10:56:50
Command: bootstdz_surv
PrY_a0: r(boot_0)
PrY_a1: r(boot_1)
difference: r(boot_diff)
Simulations (10): .........10 done
r; t=24.54 14:44:01
r; t=23.06 10:57:13
Expand Down
24 changes: 12 additions & 12 deletions docs/18-session-info-r.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,31 @@ sessioninfo::session_info()
#> ─ Session info ───────────────────────────────────────────────────────────────
#> setting value
#> version R version 4.3.3 (2024-02-29)
#> os macOS Sonoma 14.3.1
#> os macOS Sonoma 14.4
#> system aarch64, darwin20
#> ui X11
#> language (EN)
#> collate en_US.UTF-8
#> ctype en_US.UTF-8
#> tz Europe/London
#> date 2024-03-02
#> pandoc 3.1.12.1 @ /opt/homebrew/bin/ (via rmarkdown)
#> date 2024-03-13
#> pandoc 3.1.12.2 @ /opt/homebrew/bin/ (via rmarkdown)
#>
#> ─ Packages ───────────────────────────────────────────────────────────────────
#> package * version date (UTC) lib source
#> bookdown 0.37 2023-12-01 [1] CRAN (R 4.3.2)
#> cli 3.6.2 2023-12-11 [1] CRAN (R 4.3.2)
#> digest 0.6.34 2024-01-11 [1] CRAN (R 4.3.2)
#> bookdown 0.38 2024-03-04 [1] CRAN (R 4.3.1)
#> cli 3.6.2 2023-12-11 [1] CRAN (R 4.3.1)
#> digest 0.6.35 2024-03-11 [1] CRAN (R 4.3.3)
#> evaluate 0.23 2023-11-01 [1] CRAN (R 4.3.1)
#> fastmap 1.1.1 2023-02-24 [1] CRAN (R 4.3.0)
#> htmltools 0.5.7 2023-11-03 [1] CRAN (R 4.3.2)
#> htmltools 0.5.7 2023-11-03 [1] CRAN (R 4.3.1)
#> knitr 1.45 2023-10-30 [1] CRAN (R 4.3.1)
#> rlang 1.1.3 2024-01-10 [1] CRAN (R 4.3.2)
#> rmarkdown 2.25 2023-09-18 [1] CRAN (R 4.3.1)
#> rstudioapi 0.15.0 2023-07-07 [1] CRAN (R 4.3.1)
#> rlang 1.1.3 2024-01-10 [1] CRAN (R 4.3.1)
#> rmarkdown 2.26 2024-03-05 [1] CRAN (R 4.3.1)
#> rstudioapi 0.15.0 2023-07-07 [1] CRAN (R 4.3.0)
#> sessioninfo 1.2.2 2021-12-06 [1] CRAN (R 4.3.0)
#> xfun 0.42 2024-02-08 [1] CRAN (R 4.3.2)
#> yaml 2.3.8 2023-12-11 [1] CRAN (R 4.3.2)
#> xfun 0.42 2024-02-08 [1] CRAN (R 4.3.1)
#> yaml 2.3.8 2023-12-11 [1] CRAN (R 4.3.1)
#>
#> [1] /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library
#>
Expand Down
26 changes: 13 additions & 13 deletions docs/18-session-info-stata.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Stata/MP 18.0 for Mac (Apple Silicon)
Revision 14 Feb 2024
Copyright 1985-2023 StataCorp LLC
Total physical memory: 8.01 GB
Total physical memory: 18.00 GB
Stata license: Unlimited-user 2-core network, expiring 29 Jan 2025
Serial number: 501809305331
Expand All @@ -32,32 +32,32 @@ sessioninfo::session_info()
#> ─ Session info ───────────────────────────────────────────────────────────────
#> setting value
#> version R version 4.3.3 (2024-02-29)
#> os macOS Sonoma 14.3.1
#> os macOS Sonoma 14.4
#> system aarch64, darwin20
#> ui X11
#> language (EN)
#> collate en_US.UTF-8
#> ctype en_US.UTF-8
#> tz Europe/London
#> date 2024-03-02
#> pandoc 3.1.12.1 @ /opt/homebrew/bin/ (via rmarkdown)
#> date 2024-03-13
#> pandoc 3.1.12.2 @ /opt/homebrew/bin/ (via rmarkdown)
#>
#> ─ Packages ───────────────────────────────────────────────────────────────────
#> package * version date (UTC) lib source
#> bookdown 0.37 2023-12-01 [1] CRAN (R 4.3.2)
#> cli 3.6.2 2023-12-11 [1] CRAN (R 4.3.2)
#> digest 0.6.34 2024-01-11 [1] CRAN (R 4.3.2)
#> bookdown 0.38 2024-03-04 [1] CRAN (R 4.3.1)
#> cli 3.6.2 2023-12-11 [1] CRAN (R 4.3.1)
#> digest 0.6.35 2024-03-11 [1] CRAN (R 4.3.3)
#> evaluate 0.23 2023-11-01 [1] CRAN (R 4.3.1)
#> fastmap 1.1.1 2023-02-24 [1] CRAN (R 4.3.0)
#> htmltools 0.5.7 2023-11-03 [1] CRAN (R 4.3.2)
#> htmltools 0.5.7 2023-11-03 [1] CRAN (R 4.3.1)
#> knitr 1.45 2023-10-30 [1] CRAN (R 4.3.1)
#> rlang 1.1.3 2024-01-10 [1] CRAN (R 4.3.2)
#> rmarkdown 2.25 2023-09-18 [1] CRAN (R 4.3.1)
#> rstudioapi 0.15.0 2023-07-07 [1] CRAN (R 4.3.1)
#> rlang 1.1.3 2024-01-10 [1] CRAN (R 4.3.1)
#> rmarkdown 2.26 2024-03-05 [1] CRAN (R 4.3.1)
#> rstudioapi 0.15.0 2023-07-07 [1] CRAN (R 4.3.0)
#> sessioninfo 1.2.2 2021-12-06 [1] CRAN (R 4.3.0)
#> Statamarkdown * 0.9.2 2023-12-04 [1] CRAN (R 4.3.1)
#> xfun 0.42 2024-02-08 [1] CRAN (R 4.3.2)
#> yaml 2.3.8 2023-12-11 [1] CRAN (R 4.3.2)
#> xfun 0.42 2024-02-08 [1] CRAN (R 4.3.1)
#> yaml 2.3.8 2023-12-11 [1] CRAN (R 4.3.1)
#>
#> [1] /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library
#>
Expand Down
6 changes: 3 additions & 3 deletions docs/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>Page not found | Causal Inference: What If. R and Stata code for Exercises</title>
<meta name="description" content="Code examples from Causal Inference: What If by M. A. Hernán and J. M. Robins https://www.hsph.harvard.edu/miguel-hernan/causal-inference-book/" />
<meta name="generator" content="bookdown 0.37 and GitBook 2.6.7" />
<meta name="generator" content="bookdown 0.38 and GitBook 2.6.7" />

<meta property="og:title" content="Page not found | Causal Inference: What If. R and Stata code for Exercises" />
<meta property="og:type" content="book" />
Expand All @@ -26,7 +26,7 @@
<meta name="author" content="R Markdown code by Tom Palmer" />


<meta name="date" content="2024-03-02" />
<meta name="date" content="2024-03-13" />

<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
Expand Down Expand Up @@ -69,7 +69,7 @@
}
@media print {
pre > code.sourceCode { white-space: pre-wrap; }
pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; }
pre > code.sourceCode > span { display: inline-block; text-indent: -5em; padding-left: 5em; }
}
pre.numberSource code
{ counter-reset: source-line 0; }
Expand Down
16 changes: 8 additions & 8 deletions docs/causal-survival-analysis-stata.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>17. Causal survival analysis: Stata | Causal Inference: What If. R and Stata code for Exercises</title>
<meta name="description" content="Code examples from Causal Inference: What If by M. A. Hernán and J. M. Robins https://www.hsph.harvard.edu/miguel-hernan/causal-inference-book/" />
<meta name="generator" content="bookdown 0.37 and GitBook 2.6.7" />
<meta name="generator" content="bookdown 0.38 and GitBook 2.6.7" />

<meta property="og:title" content="17. Causal survival analysis: Stata | Causal Inference: What If. R and Stata code for Exercises" />
<meta property="og:type" content="book" />
Expand All @@ -26,7 +26,7 @@
<meta name="author" content="R Markdown code by Tom Palmer" />


<meta name="date" content="2024-03-02" />
<meta name="date" content="2024-03-13" />

<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
Expand Down Expand Up @@ -69,7 +69,7 @@
}
@media print {
pre > code.sourceCode { white-space: pre-wrap; }
pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; }
pre > code.sourceCode > span { display: inline-block; text-indent: -5em; padding-left: 5em; }
}
pre.numberSource code
{ counter-reset: source-line 0; }
Expand Down Expand Up @@ -907,15 +907,15 @@ <h2>Program 17.3<a href="causal-survival-analysis-stata.html#program-17.3-1" cla
26. drop if newseqn != 1 /* only need one pair */
27.

r; t=0.00 14:38:24
r; t=0.00 10:52:04

Command: bootipw_surv
PrY_a0: r(boot_0)
PrY_a1: r(boot_1)
difference: r(boot_diff)

Simulations (10): .........10 done
r; t=22.02 14:38:46
r; t=18.98 10:52:23



Expand Down Expand Up @@ -1136,7 +1136,7 @@ <h2>Program 17.4<a href="causal-survival-analysis-stata.html#program-17.4-1" cla
observation


file /Users/tom/Documents/GitHub/cibookex-r/figs/stata-fig-17-4.png saved as PNG
file /Users/eptmp/Documents/GitHub/cibookex-r/figs/stata-fig-17-4.png saved as PNG
format

(3,132 observations deleted)
Expand All @@ -1147,15 +1147,15 @@ <h2>Program 17.4<a href="causal-survival-analysis-stata.html#program-17.4-1" cla
5. drop if time != 0
6. /*only predict on new version of data */

r; t=0.00 14:38:54
r; t=0.00 10:52:32

Command: bootstdz_surv
PrY_a0: r(boot_0)
PrY_a1: r(boot_1)
difference: r(boot_diff)

Simulations (10): .........10 done
r; t=24.59 14:39:19
r; t=22.88 10:52:55



Expand Down
6 changes: 3 additions & 3 deletions docs/causal-survival-analysis.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>17. Causal survival analysis | Causal Inference: What If. R and Stata code for Exercises</title>
<meta name="description" content="Code examples from Causal Inference: What If by M. A. Hernán and J. M. Robins https://www.hsph.harvard.edu/miguel-hernan/causal-inference-book/" />
<meta name="generator" content="bookdown 0.37 and GitBook 2.6.7" />
<meta name="generator" content="bookdown 0.38 and GitBook 2.6.7" />

<meta property="og:title" content="17. Causal survival analysis | Causal Inference: What If. R and Stata code for Exercises" />
<meta property="og:type" content="book" />
Expand All @@ -26,7 +26,7 @@
<meta name="author" content="R Markdown code by Tom Palmer" />


<meta name="date" content="2024-03-02" />
<meta name="date" content="2024-03-13" />

<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="apple-mobile-web-app-capable" content="yes" />
Expand Down Expand Up @@ -69,7 +69,7 @@
}
@media print {
pre > code.sourceCode { white-space: pre-wrap; }
pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; }
pre > code.sourceCode > span { display: inline-block; text-indent: -5em; padding-left: 5em; }
}
pre.numberSource code
{ counter-reset: source-line 0; }
Expand Down
Binary file modified docs/cibookex-r.epub
Binary file not shown.
Binary file modified docs/cibookex-r.pdf
Binary file not shown.
Loading

0 comments on commit 76cbed4

Please sign in to comment.