onephase: onephase

Description Usage Arguments Details Value References Examples

View source: R/onephase.R

Description

onephase is used to calculate estimations exclusively based on terrestrial observations of a forest inventory (i.e. the local densities). The estimation method is available for simple and cluster-sampling and provides point estimates of the sample mean and their variances.

Usage

1
2
3
4
5
6
7
onephase(
  formula,
  data,
  phase_id = list(phase.col = NA, terrgrid.id = NA),
  cluster = NA,
  area = list(sa.col = NA, areas = NA)
)

Arguments

formula

an object of class "formula" that must be of the form Y ~ 1, where Y is the terrestrial response value of interest provided in data.

data

a data frame or vector containing the response value Y. Specifications are given under 'Details'.

phase_id

an object of class "list" containing two elements:

  • phase.col: the column name in data that specifies the phase membership of each observation

  • terrgrid.id: the indicator identifying the the terrestrial (a.k.a. "ground truth") phase for that column (must be of type "numeric")

Note: Only has to be specified if data is of class data.frame.

cluster

Specifies the column name in data containing the cluster identification. Only used in case of cluster sampling.

area

(Optional) an object of class "list" containing two elements:

  • sa.col: the column name in data containing domain identification

  • areas: vector of desired domains for which the estimation should be computed. If estimations for multiple domains should be computed, the domains have to be defined within a character vector using c()

Further details of the parameter-specifications are given under 'Details'.

Details

data can either be a vector only containing the observations of the response variable Y, or a data frame containing a column for the response variable and a column for the sample-grid indication that has to be further specified by argument phase_id. Additional optional columns include a cluster identification in case of cluster sampling, as well as a column that specifies a domain (e.g. a forest district) the respective terrestrial observation falls into. The latter allows to compute onephase-estimations for multiple domains at a time (see 'Examples').

Value

onephase returns an object of class "onephase".

The functions summary and confint can be used to obtain a summary of the estimation results (point estimations, variances and sample sizes) and the confidence intervals for the respective point estimates.

An object of class "onephase" returns a list of the following components:

input

a list containing the function inputs

estimation

a data frame containing the following components:

  • area: the domain (only present if argument area has been used)

  • estimate: the point estimate

  • variance: the variance of the point estimate

  • n2: the terrestrial sample size

samplesizes

a named numeric vector giving the terrestrial samplesize

References

Hill, A., Massey, A. F. (2021). The R Package forestinventory: Design-Based Global and Small Area Estimations for Multiphase Forest Inventories. Journal of Statistical Software, 97(4), 1-40.

Mandallaz, D. (2007). Sampling techniques for forest inventories. Chapter 4. CRC Press.

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
34
35
36
37
38
39
# ----------- non-cluster sampling------------------#

## load grisons dataset:
data(grisons)

## 1) calculate onephase-estimation for entire dataset:
op <- onephase(formula = tvol~1 ,data = grisons,
              phase_id =list(phase.col = "phase_id_2p",terrgrid.id = 2))
summary(op)
confint(op)

## 2) calculate onephase-estimation for given domains (areas) in dataset:
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")))
summary(op.a)
confint(op.a)

# ----------- cluster sampling ------------------#

## load zurichberg dataset:
data(zberg)

## 1) calculate onephase-estimation for entire dataset:
op.clust <- onephase(formula = basal~1, data = zberg,
                     phase_id = list(phase.col = "phase_id_2p",terrgrid.id = 2),
                     cluster = "cluster")
summary(op.clust)
confint(op.clust)

## 2) calculate onephase-estimation for given areas in dataset:
op.clust.a <- onephase(formula = basal~1,
                       data = zberg,
                       phase_id = list(phase.col = "phase_id_2p", terrgrid.id = 2),
                       cluster = "cluster",
                       area = list(sa.col = "ismallg23", areas = c("2", "3")))
summary(op.clust.a)
confint(op.clust.a)

Example output

One-phase estimation
 
Call: 
onephase(formula = tvol ~ 1, data = grisons, phase_id = list(phase.col = "phase_id_2p", 
    terrgrid.id = 2))

Method used:
One-phase estimator
 
Estimation results:
 estimate variance n2
 399.4321 567.2001 67



95% Confidence Intervals for onephase global estimation
 
  estimate ci_lower_op ci_upper_op
1 399.4321     351.882    446.9822


One-phase estimation
 
Call: 
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")))

Method used:
One-phase estimator
 
Estimation results:
 area estimate variance n2
    A 410.4047 1987.117 19
    B 461.4429 3175.068 17



95% Confidence Intervals for onephase global estimation
 
  area estimate ci_lower_op ci_upper_op
1    A 410.4047    316.7517    504.0577
2    B 461.4429    341.9911    580.8948


One-phase estimation
 
Call: 
onephase(formula = basal ~ 1, data = zberg, phase_id = list(phase.col = "phase_id_2p", 
    terrgrid.id = 2), cluster = "cluster")

Method used:
One-phase estimator for cluster sampling
 
Estimation results:
 estimate variance n2
 31.89805 1.164348 73



95% Confidence Intervals for onephase global estimation
 
  estimate ci_lower_op ci_upper_op
1 31.89805    29.74701     34.0491


One-phase estimation
 
Call: 
onephase(formula = basal ~ 1, data = zberg, phase_id = list(phase.col = "phase_id_2p", 
    terrgrid.id = 2), cluster = "cluster", area = list(sa.col = "ismallg23", 
    areas = c("2", "3")))

Method used:
One-phase estimator for cluster sampling
 
Estimation results:
 area estimate variance n2
    2 30.69298 4.207877  9
    3 32.32092 4.217542 18



95% Confidence Intervals for onephase global estimation
 
  area estimate ci_lower_op ci_upper_op
1    2 30.69298    25.96264    35.42331
2    3 32.32092    27.98807    36.65378

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