plot.esttable: Plotting Estimation Results

Description Usage Arguments Examples

View source: R/plot_methods.R

Description

Function plots the estimation results of an object created by the estTable function. Provides the possibility to visualize and compare the point estimates and their estimation errors differentiated by the applied estimation method and estimator.

Usage

1
2
## S3 method for class 'esttable'
plot(x, yvar = "error", ncol = 5, yscale.free = TRUE, ...)

Arguments

x

object of class "list" "esttable" created by the estTable function.

yvar

if set to "error" (default), the estimation error is plotted on the y-axis. If set to "estimate", point estimates with their confidence intervals are plotted.

ncol

number of columns to plot small area estimations.

yscale.free

logical: should y-axis scales be free (default) or fixed.

...

ignored.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
## run onephase estimation:
op.a <- onephase(formula = tvol~1,
                 data = grisons,
                 phase_id = list(phase.col = "phase_id_2p", terrgrid.id = 2),
                 area = list(sa.col = "smallarea", areas = c("A", "B", "C", "D")))

## run small area twophase estimation:
sae.2p.est <- twophase(formula = tvol ~ mean + stddev + max + q75,
                       data = grisons,
                       phase_id = list(phase.col = "phase_id_2p", terrgrid.id = 2),
                       small_area = list(sa.col = "smallarea", areas = c("A", "B","C", "D"),
                                         unbiased = TRUE))

## run small area threephase estimation:
sae.3p.est <- threephase(formula.s0 =  tvol ~ mean,
                         formula.s1 = tvol ~ mean + stddev + max + q75,
                         data = grisons,
                         phase_id = list(phase.col = "phase_id_3p", s1.id = 1, terrgrid.id = 2),
                         small_area=list(sa.col = "smallarea", areas = c("A", "B", "C", "D"),
                                         unbiased = TRUE))

## create estimation table:
sae.table<- estTable(est.list = list(op.a, sae.2p.est, sae.3p.est), add.ci=TRUE,
                     sae = TRUE, vartypes = c("variance", "g_variance",  "ext_variance"))

## plot estimation errors:
plot(sae.table)

## plot point estimates and confidence intervals:
#  Hint: --> use ggplot2 functions to modify graphic:
library(ggplot2)
plot(sae.table, yvar = "estimate") +
   ylab("Timber Volume [m3/ha]")

forestinventory documentation built on Jan. 13, 2021, 9:11 p.m.