Functions to automate common analyses.
To use any of the functions below, simply run the source()
command and input the corresponding URL (hyperlink) as an argument, as demonstrated below:
# R code:
source(<URL>)
-
%!in%: "not in"
-
missSummary: report missingness summary
source("https://raw.githubusercontent.com/Mohamed-Albirair/my-R-functions/main/missSummary.R")
missSummary(data)
-
- Can work for single-, multi-level, linear and non-linear models!
source("https://raw.githubusercontent.com/Mohamed-Albirair/my-R-functions/main/reportModelOutputKnitr.R")
mod <- lm(y ~ a + bx, data) # desired regression model
reportModelOutputKnitr(mod) # report output
source("calAbsFitValue")
mod <- glm(y ~ a + bx, data, family = <binomial, poisson... etc.>) # desired regression model
# report fitted values at point x = 4
calAbsFitValue(model = mod, parms = (e.g., "(Intercept) + a + b * 4"))
- probToRate: from probability to rate
- rateToProb: from rate to probability
- convTransProb: convert transition probabilities between different time units