Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mids model saving fix #115

Merged
merged 1 commit into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions R/fitModel.R
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ fitModel <- function(home_dir, data, weights, exposure, exposure_time_pts, outco
if (save.out) {

sjPlot::tab_model(fits, auto.label = FALSE, show.se = TRUE,
file = file.path(home_dir, "models",
file = file.path(home_dir, "/models/",
sprintf("%s-%s_%s_table_mod_ev.docx",
exposure, outcome, model)))

Expand Down Expand Up @@ -450,7 +450,7 @@ fitModel <- function(home_dir, data, weights, exposure, exposure_time_pts, outco
if (save.out) {

sjPlot::tab_model(fits, auto.label = FALSE, show.se = TRUE,
file = file.path(home_dir, "models",
file = file.path(home_dir, "/models/",
sprintf("%s-%s_%s_table_mod_ev.docx",
exposure, outcome, model)))
# # require(sur
Expand Down
9 changes: 7 additions & 2 deletions examplePipelineRevised.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ prebalance_stats <- assessBalance(home_dir, data, exposure, exposure_time_pts, o


### STEP 2: Determine optimal weighting method
#### 2a. Create short formulas
#### 2a. Create simplified balancing formulas
```{r}

#optional list of concurrent confounder
Expand Down Expand Up @@ -386,7 +386,7 @@ short_formulas <- createFormulas(home_dir, exposure, exposure_time_pts, outcome,

```

#### 2b. Create weights with all weighting methods
#### 2b. Create IPTW Balancing Weights using Multiple Weighting Methods
```{r}

## Create balancing weights with simplified formulas
Expand Down Expand Up @@ -625,6 +625,10 @@ final_balance_stats <- assessBalance(home_dir, data, exposure, exposure_time_pts
#minimum input
final_balance_stats <- assessBalance(home_dir, data, exposure, exposure_time_pts, outcome, type, formulas, weights)


#remaining imbalanced covariates that are time-invariant or measured at t=1 ---manually add
imbalanced_covars <- c("ESETA1.6", "gov_asst", "B18Raw.6")

```
#### Sensitvity analyses
```{r}
Expand Down Expand Up @@ -657,6 +661,7 @@ int_order = 3
int_order = NA

#covariates (required for covariate models m1, m3)
covariates <- imbalanced_covariates
covariates <- c("ESETA1.6", "gov_asst", "B18Raw.6")
covariates = NULL

Expand Down