Description Usage Arguments Value Note See Also Examples
Computation of posterior probabilities for new units.
1 |
x |
Object of class |
newdata |
Object of class |
An object of class data.frame
with one entry for each unit, containing the posterior probability of each group for that unit.
Data in newdata
must be expressed on the original scale of the indicators. Normalisation is applied internally.
gbmt.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | data(agrisus2)
# names of indicators (just a subset for illustration)
varNames <- c("TFP_2005", "NetCapital_GVA",
"Income_rur", "Unempl_rur", "GHG_UAA", "GNB_N_UAA")
# model with 2 polynomial degrees and 3 groups
m3_2 <- gbmt(x.names=varNames, unit="Country", time="Year", d=2, ng=3, data=agrisus2, scaling=4)
# pretend that 'Italy' is a new unit
posterior(m3_2, newdata=agrisus2[which(agrisus2$Country=="Italy"),])
# consider only the last 3 years
posterior(m3_2, newdata=
agrisus2[which(agrisus2$Country=="Italy"&agrisus2$Year>=2016),]
)
# provide more than one new unit
posterior(m3_2, newdata=
agrisus2[which(agrisus2$Country%in%c("Italy","Austria","Greece")),]
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.