a function to model curves using a spatial P-Spline modelling using SpATS library

fitSpATS(
  datain,
  trait,
  genotypeId,
  rowId,
  colId,
  typeModel = "anova",
  genotype.as.random = FALSE,
  nseg = c(14, 30),
  verbose
)

Arguments

datain

input dataframe of parameters

trait

character, parameter of interest (ex: Biomass24)

genotypeId

character, column name of genotype alias

rowId

character, column name of the row id in the lattice (greenhouse or field)

colId

character, column name of the column id in the lattice (greenhouse or field)

typeModel

character, choice of the spatial P-Spline model, anova or sap

genotype.as.random

logical. If TRUE, the genotype is included as random effect in the model. The default is FALSE.

nseg

numerical vector of length 2 containing the number of segments for each marginal (strictly nseg - 1 is the number of internal knots in the domain of the covariate). Atomic values are also valid, being recycled. Default set to c(14,30)

verbose

logical FALSE by default, if TRUE display information about the progress

Value

a SpATS object

Details

the input dataset must contain Position,Line,Ref,scenario,genotypeAlias columns

See also

SpATS, PSANOVA and SAP

Examples

# \donttest{ mydata<-plant4 test<-fitSpATS(datain=mydata,trait="Biomass24",genotypeId="genotypeAlias",rowId="Line", colId="Position",typeModel="anova",genotype.as.random=FALSE,nseg=c(14,30),verbose)
#> Effective dimensions #> ------------------------- #> It. Deviance C R f(Line) f(Position)f(Line):PositionLine:f(Position)f(Line):f(Position) #> 1 123559.752371 8.846 6.592 4.115 10.640 4.641 10.043 54.308 #> 2 8348.931485 9.316 8.333 5.826 10.002 3.290 7.291 39.324 #> 3 8331.017434 10.113 8.812 6.076 9.170 2.824 5.333 28.497 #> 4 8318.901739 11.224 8.983 6.117 8.111 2.610 3.671 21.197 #> 5 8311.216526 12.649 9.053 6.114 6.826 2.483 2.565 16.448 #> 6 8306.340008 14.292 9.090 6.104 5.397 2.400 2.318 13.370 #> 7 8302.852951 15.912 9.116 6.095 4.071 2.343 2.317 11.392 #> 8 8301.334144 17.214 9.136 6.088 3.239 2.306 2.336 10.072 #> 9 8300.961308 18.105 9.152 6.083 2.969 2.281 2.352 9.157 #> 10 8300.809391 18.704 9.163 6.079 2.919 2.265 2.366 8.485 #> 11 8300.720106 19.111 9.169 6.076 2.909 2.254 2.378 7.966 #> 12 8300.663881 19.386 9.172 6.075 2.906 2.246 2.387 7.551 #> 13 8300.626712 19.569 9.174 6.073 2.905 2.240 2.395 7.213 #> 14 8300.601056 19.690 9.174 6.072 2.905 2.236 2.402 6.932 #> 15 8300.582688 19.769 9.175 6.072 2.906 2.232 2.407 6.695 #> 16 8300.569147 19.821 9.175 6.071 2.907 2.229 2.412 6.493 #> 17 8300.558925 19.855 9.174 6.071 2.909 2.227 2.416 6.319 #> 18 8300.551062 19.877 9.174 6.070 2.910 2.225 2.420 6.167 #> 19 8300.544919 19.891 9.174 6.070 2.912 2.223 2.423 6.034 #> 20 8300.540059 19.900 9.173 6.070 2.913 2.221 2.426 5.917 #> 21 8300.536171 19.906 9.173 6.070 2.915 2.220 2.429 5.813 #> 22 8300.533032 19.909 9.173 6.070 2.916 2.219 2.431 5.720 #> 23 8300.530476 19.912 9.173 6.069 2.917 2.218 2.433 5.636 #> 24 8300.528381 19.913 9.172 6.069 2.918 2.217 2.435 5.561 #> 25 8300.526651 19.914 9.172 6.069 2.919 2.216 2.436 5.493 #> 26 8300.525215 19.914 9.172 6.069 2.920 2.215 2.438 5.432 #> 27 8300.524017 19.914 9.172 6.069 2.921 2.215 2.439 5.376 #> 28 8300.523012 19.914 9.172 6.069 2.922 2.214 2.440 5.325 #> 29 8300.522166 19.914 9.171 6.069 2.922 2.213 2.442 5.278 #> Timings: #> SpATS 5.19 seconds #> All process 6.25 seconds
# }