ElMaestro
★★★

Denmark,
2011-11-05 18:11
(5349 d 04:48 ago)

Posting: # 7614
Views: 5,625
 

 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.

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
UA Flag
Activity
 Admin contact
23,655 posts in 4,993 threads, 1,570 registered users;
264 visitors (0 registered, 264 guests [including 17 identified bots]).
Forum time: 23:59 CEST (Europe/Vienna)

The real struggle is not between the right and the left
but between the party of the thoughtful
and the party of the jerks.    Jimmy Wales

The Bioequivalence and Bioavailability Forum is hosted by
BEBAC Ing. Helmut Schütz
HTML5