Views
- State: visible
ejercicio 16 práctica 2
Size 1 kB - File type text/plainFile contents
tablaAnova=function(salida,y){ p=length(salida$coefficients) n=length(y) ssreg=sum((salida$fitted.value-mean(y))^2) ssres=sum((salida$fitted.value-y)^2) ssT=sum((y-mean(y))^2) F=(ssreg/(p-1))/(ssres/(n-p)) pr=1-pf(F,p-1,n-p) salida=list(ssreg,p-1,ssres,n-p,ssT,F,pr) names(salida)=c("ssreg","glssreg","ssres","glssres","ssT","F","pvalor") salida }