Description Usage Arguments Value Author(s) See Also Examples
Drops observations from STmodel, removing marked observations
along with the corresponding locations and recomputes a number of relevant
elements.
1 | dropObservations(STmodel, Ind.cv)
|
STmodel |
Model object from which to drop observations. |
Ind.cv |
A logical vector with one element per observation in |
Returns the STmodel without the observations marked by
Ind.cv. Only observed locations are retained.
Johan Lindstrom
Other STmodel functions: createCV,
createDataMatrix,
createSTmodel,
estimateBetaFields,
loglikeSTdim, loglikeST,
predictNaive, processLUR,
processLocation, updateCovf,
updateTrend.STdata
Other cross-validation functions: computeLTA,
createCV, estimateCV.STmodel,
predictNaive
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ##load data
data(mesa.model)
##Mark 30% of observations
I <- runif(dim(mesa.model$obs)[1])<.3
##drop these observations
mesa.model.new <- dropObservations(mesa.model, I)
##This reduces the remaining number of observations
print(mesa.model)
print(mesa.model.new)
##create cross validation structure
Icv <- createCV(mesa.model, groups=10)
##drop observations from the second CV group
mesa.model.new <- dropObservations(mesa.model, Icv==2)
##This reduces the remaining number of observations (and locations)
print(mesa.model)
print(mesa.model.new)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.