ElMaestro's Silly-o-Meter [🇷 for BE/BA]
Dear all,
because bad habits apparently die hard, I am proud to present a fantastic new piece of buggy R code.
It is nothing less than a sensational Silly-o-Meter which takes the temperature of the way a model is specified and gives a diagnosis.
How to use this magnificent tool:
If you have a model specified like
then simply run it with the simple syntax:
Good luck to everyone. Am looking forward to hearing some hi-scores.
because bad habits apparently die hard, I am proud to present a fantastic new piece of buggy R code.
It is nothing less than a sensational Silly-o-Meter which takes the temperature of the way a model is specified and gives a diagnosis.
ElMaestros.Silly.o.Meter=function (Some.Model)
{
mx = model.matrix(Some.Model)
nRows = dim(mx)[1]
nCols = dim(mx)[2]
nSilly = 0
for (c in 1: nCols)
{
n=0
for (r in 1: nRows) {if (mx[r,c] != 0) n = n+1}
if (n==0) nSilly = nSilly+1
}
x = 100 * nSilly/nCols
cat("Congratulations! You specified a model with a model matrix that is", x, "percent meaningless.\n")
}
How to use this magnificent tool:
If you have a model specified like
M = lm(logAUC ~ 0 + Trt + Per + Subj%in%Seq + Seq)
then simply run it with the simple syntax:
ElMaestros.Silly.o.Meter(M)
Good luck to everyone. Am looking forward to hearing some hi-scores.
—
Pass or fail!
ElMaestro
Pass or fail!
ElMaestro
Complete thread:
- ElMaestro's Silly-o-MeterElMaestro 2011-11-05 17:11 [🇷 for BE/BA]