-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME.Rmd
More file actions
100 lines (71 loc) · 1.85 KB
/
README.Rmd
File metadata and controls
100 lines (71 loc) · 1.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
---
title: "tibbletest"
output: github_document
---
[](https://travis-ci.org/MethodsConsultants/tibbletest)
[](https://codecov.io/gh/MethodsConsultants/tibbletest?branch=master)
## Installation
Install the development version from [GitHub](https://github.com/) with:
```{r, eval = FALSE}
devtools::install_github("MethodsConsultants/tibbletest")
```
## Usage
#### `propensity_weighting`
```{r, error = TRUE}
library(tibbletest)
example_dat %>%
add_propensity_weights(
treatment = "treat",
ivs = c("age", "sugar_factor", "gender")
)
example_dat %>%
tidyr::drop_na(treat, age) %>%
add_propensity_weights(
treatment = "treat",
ivs = c("age", "sugar_factor", "gender")
) %>%
dplyr::glimpse()
```
#### `descriptives`
```{r}
example_dat %>%
descriptives(
treatment = "treat",
variables = c("age", "sugar_factor", "gender", "happiness", "happy")
)
example_dat %>%
dplyr::select(treat, age, gender) %>%
descriptives(
treatment = "treat"
)
example_dat %>%
dplyr::select(treat, weight, age, gender) %>%
descriptives(
treatment = "treat",
weights = "weight"
)
example_dat %>%
descriptives(
treatment = "treat",
variables = c("age", "sugar_factor", "gender", "happiness", "happy"),
nonparametric = c("age")
)
```
#### `format_tbl`
```{r}
univariate <- example_dat %>%
descriptives(
variables = c("age", "sugar_factor", "gender", "happiness", "happy")
)
univariate
univariate %>%
format_tbl()
bivariate <- example_dat %>%
descriptives(
treatment = "treat",
variables = c("age", "sugar_factor", "gender", "happiness", "happy")
)
bivariate
bivariate %>%
format_tbl()
```