Learn R Programming

FIESTA (version 3.6.4)

modGBarea: Green-Book module - Generate area estimates.

Description

Generates area estimates by domain (and estimation unit). Calculations are based on Scott et al. 2005 ('the green-book') for mapped forest inventory plots. The non-ratio estimator for estimating area by stratum and domain is used. Plots that are totally nonsampled are excluded from estimation dataset. Next, an adjustment factor is calculated by strata to adjust for nonsampled (nonresponse) conditions that have proportion less than 1. The attribute is the proportion of the plot which is divided by the adjustment factor, and averaged by stratum. Strata means are combined using the strata weights and then expanded to area using the total land area in the population.

Usage

modGBarea(
  GBpopdat,
  landarea = "FOREST",
  pcfilter = NULL,
  rowvar = NULL,
  colvar = NULL,
  sumunits = TRUE,
  returntitle = FALSE,
  savedata = FALSE,
  table_opts = NULL,
  title_opts = NULL,
  savedata_opts = NULL,
  gui = FALSE,
  ...
)

Value

A list with estimates with percent sampling error for rowvar (and colvar). If sumunits=TRUE or unitvar=NULL and colvar=NULL, one data frame is returned. Otherwise, a list object is returned with the following information. If savedata=TRUE, all data frames are written to outfolder.

est

Data frame. Area estimates, in area units (e.g., acres), by rowvar, colvar (and estimation unit). If sumunits=TRUE or one estimation unit and colvar=NULL, or allin1=TRUE, estimates and percent sampling error are in one data frame.

pse

Data frame. Percent sampling errors (Confidence level 68 for estimates by rowvar and colvar (and estimation unit).

titlelst

List. If returntitle=TRUE a list with table title(s). The list contains one title if est and pse are in the same table and two titles if est and pse are in separate tables. Row and column tables are also included in list.

raw

List. If rawdata=TRUE, a list including the processing data used for estimation including: number of plots and conditions; stratification information; and 1 to 8 tables with calculated values for table cells and totals (See processing data below).

Raw data

plotsampcnt

Table. Number of plots by plot status (e.g., sampled forest on plot, sampled nonforest, nonsampled).

condsampcnt

DF. Number of conditions by condition status (forest land, nonforest land, noncensus water, census water, nonsampled).

unitarea

DF. Area by estimation unit.

expcondtab

DF. Condition-level area expansion factors.

domdat

DF. Final data table used for estimation.

stratdat

Data frame. Strata information by estimation unit.

VariableDescription
unitvarestimation unit
strvarstratum value
strwtvarnumber of pixels by strata and estimation unit
n.stratanumber of plots in strata (after totally nonsampled plots removed)
n.totalnumber of plots for estimation unit
strwtproportion of area (or plots) by strata and estimation unit (strata weight)
CONDPROP_UNADJ_SUMsummed condition proportion by strata and estimation unit
CONDPROP_ADJFACadjusted condition proportion by strata after nonresponse plots removed
AREAtotal area for estimation unit
CONDPROP_ADJFACaverage area

processing data

Data frames. Separate data frames containing calculated variables used in estimation process. The number of processing tables depends on the input parameters. The tables include: total by estimation unit (unit.totest); rowvar totals (unit.rowest), colvar totals, if not NULL (unit.colvar); and a combination of rowvar and colvar, if colvar is not NULL (unit.grpvar). If sumunits=TRUE, the raw data for the summed estimation units are also included (totest, rowest, colest, grpest, respectively). These tables do not included estimate proportions (nhat and nhat.var).

The data frames include the following information:

VariableDescription
nhatestimate proportion of land
nhat.varvariance estimate of estimated proportion of land
NBRPLT.gt0Number of non-zero plots used in estimates
AREAtotal area for estimation unit
estestimated area of land nhat*areavar
est.varvariance estimate of estimate acres of land nhat.var*areavar^2
est.sestandard error of estimated area of land sqrt(est.var)
est.cvcoefficient of variation of estimated area of land est.se/est
psepercent sampling error of estimate est.cv*100
CI99leftleft tail of 99 percent confidence interval for estimated area
CI99rightright tail of 99 percent confidence interval for estimated area
CI95leftleft tail of 95 percent confidence interval for estimated area
CI95rightright tail of 95 percent confidence interval for estimated area
CI67leftleft tail of 67 percent confidence interval for estimated area
CI67rightright tail of 67 percent confidence interval for estimated area

savedata

if savedata=TRUE...

tables with estimate and percent standard error will be written as *csv files to outfolder. if rawdata=TRUE, the rawdata will be output to the outfolder in a folder named rawdata (if raw_fmt="csv") or a database in the outfolder, if (raw_fmt != "csv").

if outfn.pre is not null...

a prefix is added to output files if raw_fmt = 'csv', prefix is added to file names in rawdata folder if raw_fmt != 'csv', prefix is added to dsn name

Arguments

GBpopdat

List. Population data objects returned from modGBpop().

landarea

String. The sample area filter for estimates ("ALL", "FOREST", "TIMBERLAND"). If landarea=FOREST, filtered to COND_STATUS_CD = 1; If landarea=TIMBERLAND, filtered to SITECLCD in(1:6) and RESERVCD = 0.

pcfilter

String. A filter for plot or cond attributes (including pltassgn). Must be R logical syntax.

rowvar

String. Name of row domain variable in cond. If only one domain, rowvar = domain variable. If more than one domain, include colvar. If no domain, rowvar = NULL.

colvar

String. Name of column domain variable in cond.

sumunits

Logical. If TRUE, estimation units are summed and returned in one table.

returntitle

Logical. If TRUE, returns title(s) of the estimation table(s).

savedata

Logical. If TRUE, saves table(s) to outfolder.

table_opts

List. See help(table_options()) for a list of options.

title_opts

List. See help(title_options()) for a list of options.

savedata_opts

List. See help(savedata_options()) for a list of options. Only used when savedata = TRUE.

gui

Logical. If gui, user is prompted for parameters.

...

Parameters for modGBpop() if GBpopdat is NULL.

Author

Tracey S. Frescino, Paul L. Patterson, Elizabeth A. Freeman

Details

If variables are NULL, then it will prompt user to input variables.

Necessary variables:

DataVariableDescription
condcuniqueidUnique identifier for each plot, to link to pltassgn (ex. PLT_CN).
CONDIDUnique identifier of each condition on plot. Set CONDID=1, if only 1 condition per plot.
CONDPROP_UNADJUnadjusted proportion of condition on each plot. Set CONDPROP_UNADJ=1, if only 1 condition per plot.
COND_STATUS_CDStatus of each forested condition on plot (i.e. accessible forest, nonforest, water, etc.)
NF_COND_STATUS_CDIf ACI=TRUE. Status of each nonforest condition on plot (i.e. accessible nonforest, nonsampled nonforest)
SITECLCDIf landarea=TIMBERLAND. Measure of site productivity.
RESERVCDIf landarea=TIMBERLAND. Reserved status.
pltassgnpuniqueidUnique identifier for each plot, to link to cond (ex. CN).
STATECDIdentifies state each plot is located in.
INVYRIdentifies inventory year of each plot.
PLOT_STATUS_CDStatus of each plot (i.e. sampled, nonsampled). If not included, all plots are assumed as sampled.

For available reference tables: sort(unique(FIESTAutils::ref_codes$VARIABLE))

References

Scott, Charles T.; Bechtold, William A.; Reams, Gregory A.; Smith, William D.; Westfall, James A.; Hansen, Mark H.; Moisen, Gretchen G. 2005. Sample-based estimators used by the Forest Inventory and Analysis national information management system. Gen. Tech. Rep. SRS-80. Asheville, NC: U.S. Department of Agriculture, Forest Service, Southern Research Station, p.53-77.

Examples

Run this code
# \donttest{
GBpopdat <- modGBpop(
popTabs = list(cond = FIESTA::WYcond,  
               tree = FIESTA::WYtree,        
               seed = FIESTA::WYseed),      
popTabIDs = list(cond = "PLT_CN"),            
pltassgn = FIESTA::WYpltassgn,  
pltassgnid = "CN",        
pjoinid = "PLT_CN",         
unitarea = FIESTA::WYunitarea,
unitvar = "ESTN_UNIT",        
strata = TRUE,           
stratalut = WYstratalut,    
strata_opts = strata_options(getwt = TRUE)   
)

forest_area <- modGBarea(
GBpopdat = GBpopdat, 
landarea = "FOREST",  
sumunits = TRUE,      
)
str(forest_area, max.level = 1)

forest_area_by_forest_type <- modGBarea(
GBpopdat = GBpopdat,        
landarea = "FOREST",       
rowvar = "FORTYPCD",        
sumunits = TRUE            
)
str(forest_area_by_forest_type, max.level = 1)
# }

Run the code above in your browser using DataLab