View source: R/smplSizPredModel.R
smplSizPredModel | R Documentation |
This function generates a linear regression model to predict the number of replicates (NoOfReplicates
) based on heritability, power, fold change, and tissue type. The model is generated depending on whether the tissue information is provided in the data. The function returns the fitted model.
smplSizPredModel(
df4model = df4modelInpt,
heritabilityClass,
inptPwr,
fc,
trait = NULL,
tissue = NULL
)
df4model |
A data frame containing the input data for the model. It should include the following columns: |
heritabilityClass |
A character value indicating the class of heritability used for filtering the data. |
inptPwr |
A numeric value representing the power used in the model. |
fc |
A numeric value representing the fold change used in the model. |
trait |
An optional parameter to specify the trait. If provided, it can be used for further filtering, but it's not currently used in the function. |
tissue |
An optional parameter specifying the tissue type. If provided, the model will include the tissue information in the regression. If not provided, the model will exclude tissue information. |
A linear model object (lm
class), which contains the fitted linear regression model for the number of replicates prediction.
Sun et al. (2017) \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1093/nar/gkx204")}
# Example usage:
df4modelInpt <- data.frame(
NoOfReplicates = c(3, 5, 7, 9, 11),
HeritabilityClass = c("high", "mid", "low", "high", "mid"),
HeritabilityValue = c(0.5, 0.6, 0.7, 0.5, 0.6),
pwr = c(0.8, 0.9, 0.85, 0.88, 0.86),
FoldChange = c(2, 3, 2.5, 2.8, 3.2),
Tissue = c("Liver", "Liver", "Kidney", "Liver", "Kidney")
)
# Fit the model
model <- smplSizPredModel(
df4model = df4modelInpt,
heritabilityClass = "high",
inptPwr = 0.8,
fc = 2,
tissue = "Liver"
)
# Summarize the results
summary(model)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.