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

Default values for impute's references #286

Open
gowerc opened this issue Feb 6, 2022 · 5 comments
Open

Default values for impute's references #286

gowerc opened this issue Feb 6, 2022 · 5 comments
Labels
To be evaluated issues that must be discussed whether/how they have to be implemented

Comments

@gowerc
Copy link
Collaborator

gowerc commented Feb 6, 2022

I was wondering whether we should provide default values for references in impute ? As in I imagine in 90% of cases people are just going to do c("placebo" = "placebo", "treatment" = "placebo") so I'm wondering if we should just automatically infer this based upon the labels of the group variable if nothing is passed to the arguement (just makes it slightly easier for users I am thinking)

i.e. (pseudo code)

if  references is null:
    labels = levels(groups)
    references  =  c(
        labels[1] = labels[1],  
        labels[2] = labels[1]
    )
@gowerc gowerc added the To be evaluated issues that must be discussed whether/how they have to be implemented label Feb 6, 2022
@gowerc
Copy link
Collaborator Author

gowerc commented Feb 6, 2022

@wolbersm & @nociale

@nociale
Copy link
Collaborator

nociale commented Feb 7, 2022

@gowerc How is it possible to understand which level of vars$group refers to control and which to intervention, without any specification from the user?

I agree most of cases will be "Control" = "Control", "Intervention" = "Control" but I think it is easy and clear for the user.

@wolbersm
Copy link
Collaborator

wolbersm commented Feb 7, 2022

@gowerc I agree with @nociale and would prefer no default.

To me, the only setting where we should use default values for reference is the case where all ICEs are imputed under "MAR" and in this case, reference should be c("group1"="group1","group2"="group2",etc.)

@gowerc
Copy link
Collaborator Author

gowerc commented Feb 9, 2022

I was thinking of just using standard factor notation where the first level is considered to be the reference/control.

i.e.

if (length(levels(group)) > 2 ) stop("too many groups to automatically decide")
lvls <- levels(group)
references <- lvls
names(references) <- c(lvls[1], lvls[1])

I just figured that this likely covers 90% of real world usecase so would make sense to default to it to save users some hassle. No worries if you feel its more likely to add complications / confusion

@wolbersm
Copy link
Collaborator

wolbersm commented Feb 9, 2022

Easy enough but I still feel it's better to force the user to provide the reference manually whenever reference-based imputation is used.
For example, if for some reason the first level of the factor is the intervention (which I guess can happen if you call them "intervention" and "placebo" and just naively use factor which uses alphabetical ordering), then this gives completely wrong results but this is not totally obvious to recognize from the outputs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
To be evaluated issues that must be discussed whether/how they have to be implemented
Projects
None yet
Development

No branches or pull requests

3 participants