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")),]
)
Run the code above in your browser using DataLab