This function performs the analysis of a randomized block design in a split-plot with a subplot in a double factorial scheme.

PSUBFAT2DBC(
f1,
f2,
f3,
block,
resp,
alpha.f = 0.05,
alpha.t = 0.05,
norm = "sw",
homog = "bt",
mcomp = "tukey"
)

## Arguments

f1

Numeric or complex vector with plot levels

f2

Numeric or complex vector with splitplot levels

f3

Numeric or complex vector with splitsplitplot levels

block

Numeric or complex vector with blocks

resp

Numeric vector with responses

alpha.f

Level of significance of the F test (default is 0.05)

alpha.t

Significance level of the multiple comparison test (default is 0.05)

norm

Error normality test (default is Shapiro-Wilk)

homog

Homogeneity test of variances (default is Bartlett)

mcomp

Multiple comparison test (Tukey (default), LSD and Duncan)

## Value

Analysis of variance of fixed effects and multiple comparison test of Tukey, Scott-Knott, LSD or Duncan.

## Examples

f1=rep(c("PD","PDE","C"), e = 40);f1=factor(f1,unique(f1))
f2=rep(c(300,400), e = 20,3);f2=factor(f2,unique(f2))
f3=rep(c("c1", "c2", "c3", "c4"), e = 5,6);f3=factor(f3,unique(f3))
bloco=rep(paste("B",1:5),24); bloco=factor(bloco,unique(bloco))
set.seed(10)
resp=rnorm(120,50,5)
PSUBFAT2DBC(f1,f2,f3,bloco,resp,alpha.f = 0.5) # force triple interaction
#> Warning: Error() model is singular
#>
#> -----------------------------------------------------------------
#> Normality of errors
#> -----------------------------------------------------------------
#>                          Method Statistic   p.value
#>  Shapiro-Wilk normality test(W) 0.9913894 0.6632354
#>
#> As the calculated p-value is greater than the 5% significance level, hypothesis H0 is not rejected. Therefore, errors can be considered normal
#>
#> -----------------------------------------------------------------
#> Homogeneity of Variances
#> -----------------------------------------------------------------
#>                               Method Statistic   p.value
#>  Bartlett test(Bartlett's K-squared)  29.86522 0.1533099
#>
#> As the calculated p-value is greater than the 5% significance level, hypothesis H0 is not rejected. Therefore, the variances can be considered homogeneous
#>
#> -----------------------------------------------------------------
#> -----------------------------------------------------------------
#>
#> CV 1 (%) =  8.29
#> CV 2 (%) =  9.01
#> Mean =  49.6176
#> Median =  49.5507
#> Possible outliers =  No discrepant point
#>
#> -----------------------------------------------------------------
#> Analysis of Variance
#> -----------------------------------------------------------------
#>              df         SS        MS   F-value          p
#> F1            2  200.80976 100.40488 5.9356627 0.02626955
#> block         4   72.31228  18.07807 1.0687262 0.43175774
#> Error A       8  135.32424  16.91553
#> F2            1   90.72529  90.72529 4.5377346 0.03608042
#> F3            3   61.85881  20.61960 1.0313143 0.38303103
#> F1 x F2       2   60.27090  30.13545 1.5072608 0.22744536
#> F1 x F3       6   86.85448  14.47575 0.7240219 0.63141782
#> F2 x F3       3  138.29564  46.09855 2.3056742 0.08260633
#> F1 x F2 x F3  6  115.28713  19.21452 0.9610374 0.45668802
#> Residuals    84 1679.45575  19.99352
#>
#> -----------------------------------------------------
#> Analyzing  F2  inside of each level of  F1 and F3
#> -----------------------------------------------------
#>                    Df       Sum sq      Mean Sq      F value     Pr(>F)
#> f1:f3:f2           12 4.045790e+02 3.371491e+01 1.6862919294 0.08437225
#>    f1:f3:f2 PD c1   1 6.248158e+01 6.248158e+01 3.1250913552 0.08072679
#>    f1:f3:f2 PDE c1  1 5.754416e-01 5.754416e-01 0.0287814019 0.86569266
#>    f1:f3:f2 C c1    1 3.139833e+01 3.139833e+01 1.5704253218 0.21362233
#>    f1:f3:f2 PD c2   1 1.506184e+00 1.506184e+00 0.0753335835 0.78439762
#>    f1:f3:f2 PDE c2  1 2.056254e+00 2.056254e+00 0.1028460179 0.74923713
#>    f1:f3:f2 C c2    1 8.697023e-03 8.697023e-03 0.0004349921 0.98340962
#>    f1:f3:f2 PD c3   1 7.579835e+01 7.579835e+01 3.7911457435 0.05486583
#>    f1:f3:f2 PDE c3  1 1.254129e+02 1.254129e+02 6.2726766866 0.01419419
#>    f1:f3:f2 C c3    1 3.714302e+00 3.714302e+00 0.1857752589 0.66756041
#>    f1:f3:f2 PD c4   1 4.318861e+01 4.318861e+01 2.1601300773 0.14536832
#>    f1:f3:f2 PDE c4  1 2.700789e-01 2.700789e-01 0.0135083189 0.90775141
#>    f1:f3:f2 C c4    1 5.816824e+01 5.816824e+01 2.9093543955 0.09176244
#> residuals          84 1.679456e+03 1.999352e+01
#>
#>
#> ------------------------------------------
#>  F2  within the combination of levels  PD  of  F1  and  c1  of   F3
#> ------------------------------------------
#>         resp groups
#> 300 48.15854      a
#> 400 43.15928      a
#>
#>
#> ------------------------------------------
#>  F2  within the combination of levels  PD  of  F1  and  c2  of   F3
#> ------------------------------------------
#>         resp groups
#> 400 47.71108      a
#> 300 46.93489      a
#>
#>
#> ------------------------------------------
#>  F2  within the combination of levels  PDE  of  F1  and  c1  of   F3
#> ------------------------------------------
#>         resp groups
#> 300 49.36217      a
#> 400 48.88240      a
#>
#>
#> ------------------------------------------
#>  F2  within the combination of levels  PDE  of  F1  and  c2  of   F3
#> ------------------------------------------
#>         resp groups
#> 400 50.78703      a
#> 300 49.88011      a
#>
#>
#> ------------------------------------------
#>  F2  within the combination of levels  C  of  F1  and  c1  of   F3
#> ------------------------------------------
#>         resp groups
#> 300 52.23990      a
#> 400 48.69599      a
#>
#>
#> ------------------------------------------
#>  F2  within the combination of levels  C  of  F1  and  c2  of   F3
#> ------------------------------------------
#>         resp groups
#> 300 51.78121      a
#> 400 51.72223      a
#>
#> -----------------------------------------------------
#> Analyzing  F3  inside of each level of  F1 and F2
#> -----------------------------------------------------
#>                      Df     Sum sq   Mean Sq   F value    Pr(>F)
#> f1:f2:f3             18  402.29605 22.349781 1.1369762 0.3301216
#>    f1:f2:f3: PD 300   3  118.75284 39.584281 2.0137282 0.1171401
#>    f1:f2:f3: PDE 300  3   47.47222 15.824074 0.8050010 0.4941058
#>    f1:f2:f3: C 300    3   26.13741  8.712471 0.4432201 0.7226428
#>    f1:f2:f3: PD 400   3   71.11234 23.704112 1.2058736 0.3118617
#>    f1:f2:f3: PDE 400  3   57.90185 19.300616 0.9818593 0.4047110
#>    f1:f2:f3: C 400    3   80.91939 26.973129 1.3721748 0.2559524
#> residuals            96 1887.09227 19.657211
#>
#>
#> ------------------------------------------
#>  F3  within the combination of levels  PD  of   F1  and  300  of   F2
#> ------------------------------------------
#>        resp groups
#> c3 47.84186      a
#> c2 47.71108      a
#> c4 46.19138      a
#> c1 43.15928      a
#>
#>
#> ------------------------------------------
#>  F3  within the combination of levels  PD  of   F1  and  400  of   F2
#> ------------------------------------------
#>        resp groups
#> c3 47.84186      a
#> c2 47.71108      a
#> c4 46.19138      a
#> c1 43.15928      a
#>
#>
#> ------------------------------------------
#>  F3  within the combination of levels  PDE  of   F1  and  300  of   F2
#> ------------------------------------------
#>        resp groups
#> c2 50.78703      a
#> c4 49.73344      a
#> c1 48.88240      a
#> c3 46.19361      a
#>
#>
#> ------------------------------------------
#>  F3  within the combination of levels  PDE  of   F1  and  400  of   F2
#> ------------------------------------------
#>        resp groups
#> c2 50.78703      a
#> c4 49.73344      a
#> c1 48.88240      a
#> c3 46.19361      a
#>
#>
#> ------------------------------------------
#>  F3  within the combination of levels  C  of   F1  and  300  of   F2
#> ------------------------------------------
#>        resp groups
#> c4 54.06542      a
#> c2 51.72223      a
#> c3 49.99311      a
#> c1 48.69599      a
#>
#>
#> ------------------------------------------
#>  F3  within the combination of levels  C  of   F1  and  400  of   F2
#> ------------------------------------------
#>        resp groups
#> c4 54.06542      a
#> c2 51.72223      a
#> c3 49.99311      a
#> c1 48.69599      a
#>
#> -----------------------------------------------------
#> Analyzing  F1  inside of each level of  F2 and F3
#> -----------------------------------------------------
#>                     Df      Sum sq   Mean Sq    F value     Pr(>F)
#> f3:f2:f1             2   59.625599 29.812800 1.52038077 0.22412954
#>    f3:f2:f1: 300 c1  2   43.979354 21.989677 1.12142039 0.33027695
#>    f3:f2:f1: 400 c1  2  105.740063 52.870031 2.69624387 0.07284810
#>    f3:f2:f1: 300 c2  2   59.625599 29.812800 1.52038077 0.22412954
#>    f3:f2:f1: 400 c2  2   44.042312 22.021156 1.12302576 0.32975990
#>    f3:f2:f1: 300 c3  2   14.716266  7.358133 0.37524700 0.68817777
#>    f3:f2:f1: 400 c3  2   36.301384 18.150692 0.92564145 0.39997561
#>    f3:f2:f1: 300 c4  2    3.296073  1.648036 0.08404588 0.91946036
#>    f3:f2:f1: 400 c4  2  155.521212 77.760606 3.96560306 0.02232123
#> Residuals combined  91 1784.398248 19.608772
#>
#>
#> ------------------------------------------
#>  F1  within the combination of levels  300  of   F2  and  c1  of   F3
#> ------------------------------------------
#>         resp groups
#> C   52.23990      a
#> PDE 49.36217      a
#> PD  48.15854      a
#>
#>
#> ------------------------------------------
#>  F1  within the combination of levels  300  of   F2  and  c2  of   F3
#> ------------------------------------------
#>         resp groups
#> C   51.78121      a
#> PDE 49.88011      a
#> PD  46.93489      a
#>
#>
#> ------------------------------------------
#>  F1  within the combination of levels  300  of   F2  and  c3  of   F3
#> ------------------------------------------
#>         resp groups
#> PD  53.34816      a
#> PDE 53.27635      a
#> C   51.21201      a
#>
#>
#> ------------------------------------------
#>  F1  within the combination of levels  300  of   F2  and  c4  of   F3
#> ------------------------------------------
#>         resp groups
#> PD  50.34775      a
#> PDE 50.06212      a
#> C   49.24180      a
#>
#>
#> ------------------------------------------
#>  F1  within the combination of levels  400  of   F2  and  c1  of   F3
#> ------------------------------------------
#>         resp groups
#> PDE 48.88240      a
#> C   48.69599      a
#> PD  43.15928      a
#>
#>
#> ------------------------------------------
#>  F1  within the combination of levels  400  of   F2  and  c2  of   F3
#> ------------------------------------------
#>         resp groups
#> C   51.72223      a
#> PDE 50.78703      a
#> PD  47.71108      a
#>
#>
#> ------------------------------------------
#>  F1  within the combination of levels  400  of   F2  and  c3  of   F3
#> ------------------------------------------
#>         resp groups
#> C   49.99311      a
#> PD  47.84186      a
#> PDE 46.19361      a
#>
#>
#> ------------------------------------------
#>  F1  within the combination of levels  400  of   F2  and  c4  of   F3
#> ------------------------------------------
#>         resp groups
#> C   54.06542      a
#> PDE 49.73344      a
#> PD  46.19138      a
PSUBFAT2DBC(f1,f2,f3,bloco,resp,alpha.f = 0.4) # force double interaction
#> Warning: Error() model is singular
#>
#> -----------------------------------------------------------------
#> Normality of errors
#> -----------------------------------------------------------------
#>                          Method Statistic   p.value
#>  Shapiro-Wilk normality test(W) 0.9913894 0.6632354
#>
#> As the calculated p-value is greater than the 5% significance level, hypothesis H0 is not rejected. Therefore, errors can be considered normal
#>
#> -----------------------------------------------------------------
#> Homogeneity of Variances
#> -----------------------------------------------------------------
#>                               Method Statistic   p.value
#>  Bartlett test(Bartlett's K-squared)  29.86522 0.1533099
#>
#> As the calculated p-value is greater than the 5% significance level, hypothesis H0 is not rejected. Therefore, the variances can be considered homogeneous
#>
#> -----------------------------------------------------------------
#> -----------------------------------------------------------------
#>
#> CV 1 (%) =  8.29
#> CV 2 (%) =  9.01
#> Mean =  49.6176
#> Median =  49.5507
#> Possible outliers =  No discrepant point
#>
#> -----------------------------------------------------------------
#> Analysis of Variance
#> -----------------------------------------------------------------
#>              df         SS        MS   F-value          p
#> F1            2  200.80976 100.40488 5.9356627 0.02626955
#> block         4   72.31228  18.07807 1.0687262 0.43175774
#> Error A       8  135.32424  16.91553
#> F2            1   90.72529  90.72529 4.5377346 0.03608042
#> F3            3   61.85881  20.61960 1.0313143 0.38303103
#> F1 x F2       2   60.27090  30.13545 1.5072608 0.22744536
#> F1 x F3       6   86.85448  14.47575 0.7240219 0.63141782
#> F2 x F3       3  138.29564  46.09855 2.3056742 0.08260633
#> F1 x F2 x F3  6  115.28713  19.21452 0.9610374 0.45668802
#> Residuals    84 1679.45575  19.99352
#> Multiple Comparison Test: Tukey HSD
#>
#> Warning: Error() model is singular
#>
#> -----------------------------------------------------
#> Analyzing  F2  inside of each level of  F1
#> -----------------------------------------------------
#>              Df       Sum sq      Mean Sq      F value     Pr(>F)
#> f1:f2         3 1.509962e+02 5.033206e+01 2.517419e+00 0.06364890
#>   f1:f2: PD   1 1.205087e+02 1.205087e+02 6.027388e+00 0.01614866
#>   f1:f2: PDE  1 3.048749e+01 3.048749e+01 1.524868e+00 0.22032730
#>   f1:f2: C    1 2.072023e-06 2.072023e-06 1.036347e-07 0.99974391
#> Residuals    84 1.679456e+03 1.999352e+01
#>
#> -----------------------------------------------------
#> Analyzing  F1  inside of each level of  F2
#> -----------------------------------------------------
#>                    Df      Sum sq   Mean Sq   F value      Pr(>F)
#> f2:f1               4 261.0806555  65.27016 3.3395896 0.013547392
#>   f2:f1: 300        2  20.9535457  10.47677 0.5677075 0.572104140
#>   f2:f1: 400        2 240.1271098 120.06355 6.5059141 0.004051541
#> Residuals combined 34   0.5427802  18.45453
#>
#> -----------------------------------------------------
#> Analyzing  F3  inside of each level of  F2
#> -----------------------------------------------------
#>              Df     Sum sq  Mean Sq  F value     Pr(>F)
#> f2            1   90.72529 90.72529 4.537735 0.03608042
#> f2:f3         6  200.15445 33.35907 1.668494 0.13882429
#>   f2:f3: 300  3   91.69873 30.56624 1.528808 0.21301183
#>   f2:f3: 400  3  108.45571 36.15190 1.808181 0.15191196
#> Residuals    84 1679.45575 19.99352
#>
#> -----------------------------------------------------
#> Analyzing  F2  inside of each level of  F3
#> -----------------------------------------------------
#>             Df       Sum sq      Mean Sq     F value      Pr(>F)
#> f3           3 6.185881e+01  20.61960309 1.031314255 0.383031028
#> f3:f2        4 2.290209e+02  57.25523189 2.863689304 0.028136793
#>   f3:f2: c1  1 6.784462e+01  67.84461738 3.393330159 0.068989287
#>   f3:f2: c2  1 2.198162e+00   2.19816232 0.109943733 0.741034050
#>   f3:f2: c3  1 1.588826e+02 158.88262698 7.946705733 0.006006889
#>   f3:f2: c4  1 9.552089e-02   0.09552089 0.004777592 0.945058275
#> Residuals   84 1.679456e+03  19.99352088
#>
#> ======================
#> Multiple comparasion
#> ======================
#>          300       400
#> c1  49.92 aA 46.913 aA
#> c2 49.532 aA 50.073 aA
#> c3 52.612 aA  48.01 aB
#> c4 49.884 aA 49.997 aA