Skip to content

More flexible specification for Z matrix #4

@adamSales

Description

@adamSales

I'm trying to help a colleague use loop and it occurred to me that it would be easier if we required less data pre-processing from the user. (Ideally it would be no harder than calling lm() in my opinion). So here's something:

Right now (I think), loop() only takes a matrix or a vector for Z
I think it would be easier for users if it also allowed data frames, like you could include a line like

if(is.data.frame(Z)) Z <- model.matrix(~.,data=Z)[,-1]

or something.

Even better would be if you could have an optional data argument to loop, and then allowed formulas. Then you could call it like:

loop(Y~Tr, covariates= ~x1+x2+x3, data=dat)

or even just

loop(Y=posttest,Tr=condition, Z=c(x1,x2,x3),data=dat)

where posttest, condition, x1-x3 are columns of dat

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions