Phil 4.8.11

7:30 – 4:30 VISIBILITY

  • Got a cold. Ick.
  • Working on a way to get exact p out of the qf function in R
  • Done! Below is my first function in R
function(calcF, dfNum, dfDenom, limit = 0.001, iter=100){

 alpha = 1;
 oldAlpha = 1;
 step = 0.5;

 for(i in 1:iter){
 newCritF = qf(alpha, dfNum, dfDenom, lower.tail = F);    
 #show(c(alpha, newCritF, calcF-newCritF, step));

 newDiff = calcF - newCritF;
 if(abs(newDiff) < limit){
 return (alpha);
 }
 if(newCritF > calcF){
 alpha = oldAlpha;
 step = step * 0.5;
 }

 oldAlpha = alpha;
 alpha = alpha-step;
 }

 return(alpha);
}