block_effects: Estimate block main effects

Description Usage Arguments Details Value Author(s) See Also

View source: R/block_effects.r


Fits a single linear model for all data in a specific condition and estimates the main effect of each abcterial block


block_effects(Dat,, cond1, cond2, keep.vars = c("Plate",
  "Experiment"), = TRUE)



A data.frame. Must contain the following columns: 'Bacteria', 'StartP' and 'EndP'. It must further contain a column matching the and keep.var parameters.

A string character indicating the name of the variable in Dat that has the lef-hand side of the linear model (i.e. the dependent variable)


The value for the 'StartP' variable in Dat. Only data where Dat$StartP == cond1 will be kept.


The value for the 'EndP' variable in Dat. Only data where Dat$EndP == cond2 will be kept.


A vector of character objects indicating which variables from Dat should be kept as covariates in the model

logcial indicats whether the desing must be created for the main effects. If FALSE, a linear model with the variables indicated by keep.vars will be produced.


This function will create a design matrix based on SynCom names. Therefore, it assumes that the SynCom names are named B#B#, where 'B' is replaced by the functiona group type ('P', "I' or 'N') and # is the block number within each functional type. It assumes that exactly nine blocks (3 per functional type) exist.

The function will also include any variable named in keep.vars as a covariate in the linear models.

Only the data that matches where Dat$StartP == cond1 & Dat$EndP == cond2 will be used to fit the model. The rest is discarded.


Returns an object of class 'lm', see lm for more info


Sur Herrera Paredes

See Also


surh/wheelP documentation built on Feb. 21, 2018, 7:40 p.m.