Skip to content

adjust data #2

Description

@stemangiola

I assume the new data for both should be the same, the second one is the right one, hwever dataset_id___altered = NA is wrong as dataset is a grouping variable, not a covariate

 mutate(brms_fit_adjusted_tissue = map(brms_fit, ~ .x |> remove_unwanted_effect(
          newdata = .x$data |> mutate(assay_groups=NA, sex = NA, age_bin = NA, disease_groups = NA, ethnicity_groups = NA), # age_bin*sex + disease_groups + ethnicity_groups + assay_groups
          robust = TRUE, 
          re_formula = ~ (1 | tissue_groups)
        ))) |> 
        mutate(brms_fit_adjusted_tissue_new = map(brms_fit, ~ .x |> remove_unwanted_effect_new(
          newdata = .x$data |> mutate(assay_groups___altered=NA, ethnicity_groups = NA, sex = NA, age_bin = NA, disease_groups___altered = NA, dataset_id___altered = NA), # age_bin*sex + disease_groups + ethnicity_groups + assay_groups
          robust = FALSE, correct_by_offset = FALSE,
          re_formula = ~ (1 | tissue_groups)
        ))) |> 

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions