This process consists of validating the variance analysis results using a simulation process of the experiment. The validation consists of comparing the calculated values of each source of variation of the simulated data with respect to the calculated values of the original data. If in more than 50 percent of the cases they are higher than the real one, then it is considered favorable and the probability reported by the ANOVA is accepted, since the P-Value is the probability of (F > F.value).
simulation.model(model, file, categorical = NULL, k, console = FALSE)
model | Model in R |
---|---|
file | Data for the study of the model |
categorical | position of the columns of the data that correspond to categorical variables |
k | Number of simulations |
console | logical, print output |
ouput linear model, lm
anova simulation
library(agricolae) #example 1 data(clay) model<-"ralstonia ~ days" simulation.model(model,clay,k=15,console=TRUE)#> #> Simulation of experiments #> Under the normality assumption #> - - - - - - - - - - - - - - - - #> Proposed model: ralstonia ~ days #> Analysis of Variance Table #> #> Response: ralstonia #> Df Sum Sq Mean Sq F value Pr(>F) #> days 1 42.128 42.128 11.969 0.0009456 *** #> Residuals 67 235.835 3.520 #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 #> --- #> Validation of the analysis of variancia for the proposed model #> Simulations: 15 #> #> Df F value % Acceptance % Rejection Criterion #> days 1 11.96848 53.33333 46.66667 acceptable #> --- #>#example 2 data(sweetpotato) model<-"yield~virus" simulation.model(model,sweetpotato,categorical=1,k=15,console=TRUE)#> #> Simulation of experiments #> Under the normality assumption #> - - - - - - - - - - - - - - - - #> Proposed model: yield~virus #> Analysis of Variance Table #> #> Response: yield #> Df Sum Sq Mean Sq F value Pr(>F) #> virus 3 1170.21 390.07 17.345 0.0007334 *** #> Residuals 8 179.91 22.49 #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 #> --- #> Validation of the analysis of variancia for the proposed model #> Simulations: 15 #> #> Df F value % Acceptance % Rejection Criterion #> virus 3 17.34478 86.66667 13.33333 acceptable #> --- #>#example 3 data(Glycoalkaloids) model<-"HPLC ~ spectrophotometer" simulation.model(model,Glycoalkaloids,k=15,console=TRUE)#> #> Simulation of experiments #> Under the normality assumption #> - - - - - - - - - - - - - - - - #> Proposed model: HPLC ~ spectrophotometer #> Analysis of Variance Table #> #> Response: HPLC #> Df Sum Sq Mean Sq F value Pr(>F) #> spectrophotometer 1 449.51 449.51 2527.1 < 2.2e-16 *** #> Residuals 23 4.09 0.18 #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 #> --- #> Validation of the analysis of variancia for the proposed model #> Simulations: 15 #> #> Df F value % Acceptance % Rejection Criterion #> spectrophotometer 1 2527.078 73.33333 26.66667 acceptable #> --- #>#example 4 data(potato) model<-"cutting~date+variety" simulation.model(model,potato,categorical=c(1,2,3),k=15,console=TRUE)#> #> Simulation of experiments #> Under the normality assumption #> - - - - - - - - - - - - - - - - #> Proposed model: cutting~date+variety #> Analysis of Variance Table #> #> Response: cutting #> Df Sum Sq Mean Sq F value Pr(>F) #> date 2 13.892 6.9459 2.0989 0.15950 #> variety 1 25.087 25.0868 7.5807 0.01554 * #> Residuals 14 46.330 3.3093 #> --- #> Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 #> --- #> Validation of the analysis of variancia for the proposed model #> Simulations: 15 #> #> Df F value % Acceptance % Rejection Criterion #> date 2 2.098904 33.33333 66.66667 nonacceptable #> variety 1 7.580726 40.00000 60.00000 nonacceptable #> --- #>