This process consists of finding the values of P-value by means of a re-sampling (permutation) process along with the values obtained by variance analysis.
resampling.model(model, data, k, console = FALSE)
model | model in R |
---|---|
data | data for the study of the model |
k | number of re-samplings |
console | logical, print output |
Model solution with resampling.
Efron, B., Tibshirani, R. (1993) An Introduction to the Boostrap. Chapman and Hall/CRC Phillip I. Good, (2001) Resampling Methods. Birkhauser. Boston . Basel . Berlin
#example 1 Simple linear regression library(agricolae) data(clay) model<-"ralstonia ~ days" analysis<-resampling.model(model,clay,k=2,console=TRUE)#> #> Resampling of the experiments #> - - - - - - - - - - - - - - #> Proposed model: ralstonia ~ days #> --- #> Resampling of the analysis of variancia for the proposed model #> Determination of the P-Value by Resampling #> Samples: 2 #> #> Df Sum Sq Mean Sq F value Pr(>F) Resampling #> days 1 42.12812 42.128116 11.96848 0.0009456218 0 #> Residuals 67 235.83468 3.519921 #> --- #>#example 2 Analysis of variance: RCD data(sweetpotato) model<-"yield~virus" analysis<-resampling.model(model,sweetpotato,k=2,console=TRUE)#> #> Resampling of the experiments #> - - - - - - - - - - - - - - #> Proposed model: yield~virus #> --- #> Resampling of the analysis of variancia for the proposed model #> Determination of the P-Value by Resampling #> Samples: 2 #> #> Df Sum Sq Mean Sq F value Pr(>F) Resampling #> virus 3 1170.2092 390.06972 17.34478 0.0007334172 0 #> Residuals 8 179.9133 22.48917 #> --- #>#example 3 Simple linear regression data(Glycoalkaloids) model<-"HPLC ~ spectrophotometer" analysis<-resampling.model(model,Glycoalkaloids,k=2,console=TRUE)#> #> Resampling of the experiments #> - - - - - - - - - - - - - - #> Proposed model: HPLC ~ spectrophotometer #> --- #> Resampling of the analysis of variancia for the proposed model #> Determination of the P-Value by Resampling #> Samples: 2 #> #> Df Sum Sq Mean Sq F value Pr(>F) Resampling #> spectrophotometer 1 449.506278 449.5062783 2527.078 5.042799e-25 0 #> Residuals 23 4.091146 0.1778759 #> --- #>#example 4 Factorial in RCD data(potato) potato[,1]<-as.factor(potato[,1]) potato[,2]<-as.factor(potato[,2]) model<-"cutting~variety + date + variety:date" analysis<-resampling.model(model,potato,k=2,console=TRUE)#> #> Resampling of the experiments #> - - - - - - - - - - - - - - #> Proposed model: cutting~variety + date + variety:date #> --- #> Resampling of the analysis of variancia for the proposed model #> Determination of the P-Value by Resampling #> Samples: 2 #> #> Df Sum Sq Mean Sq F value Pr(>F) Resampling #> variety 1 25.086806 25.086806 7.2580377 0.01952218 0.0 #> date 2 13.891758 6.945879 2.0095604 0.17670768 0.5 #> variety:date 2 4.853025 2.426513 0.7020312 0.51483592 0.0 #> Residuals 12 41.477005 3.456417 #> --- #>