Skip to content

Instantly share code, notes, and snippets.

@arnoud999
arnoud999 / Calculate omega-squared in R.R
Last active November 3, 2022 06:51
Calculate omega-squared in R
# Compute omega-squared and partial omega-squared
# By Arnoud Plantinga
# Based on http://stats.stackexchange.com/a/126520
# Functions ---------------------------------------------------------------
# Omega-squared
Omegas <- function(mod){
aovMod <- mod
if(!any(class(aovMod) %in% 'aov')) aovMod <- aov(mod)
@mrdwab
mrdwab / Cbind.R
Last active April 12, 2020 22:51
Cbind for unequal length vectors.
padNA <- function (mydata, rowsneeded, first = TRUE)
{
temp1 = colnames(mydata)
rowsneeded = rowsneeded - nrow(mydata)
temp2 = setNames(
data.frame(matrix(rep(NA, length(temp1) * rowsneeded),
ncol = length(temp1))), temp1)
if (isTRUE(first)) rbind(mydata, temp2)
else rbind(temp2, mydata)
}