A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://usdaforestservice.github.io/FIESTA/articles/FIESTA_tutorial_MA.html below:

Model-Assisted Estimators • FIESTA

View Example

This examples adds rows and columns to the output, including FIA names, for net cubic-foot volume of live trees (at least 5 inches diameter) by forest type and stand-size class, Wyoming, 2011-2013. We also use the *_options functions to return output with estimates (est) and percent standard error (pse) in same cell - est(pse) with allin1 = TRUE and save data to an outfolder with savedata = TRUE and outfolder = outfolder.

tree4 <- modMAtree(MApopdat = MApopdat,                # pop - population calculations
                   MAmethod = "greg",                  # est - model-assisted method
                   landarea = "FOREST",                # est - forest land filter
                   prednames = c("dem", "slp"),        # est - predictors to use in model
                   estvar = "VOLCFNET",                # est - net cubic-foot volume
                   estvar.filter = "STATUSCD  == 1",   # est - live trees only
                   rowvar = "FORTYPCD",                # est - row domain
                   colvar = "STDSZCD",                 # est - column domain
                   returntitle = TRUE,                 # out - return title information
                   savedata = TRUE,                    # out - save data to outfolder
                   table_opts = table_options(
                     row.FIAname = TRUE,               # est - row domain names
                     col.FIAname = TRUE,               # est - column domain names
                     allin1 = TRUE                     # out - return output with est(pse)
                   ),
                   savedata_opts = savedata_options(
                     outfolder = outfolder,            # out - outfolder for saving data
                     outfn.pre = "WY"                  # out - prefix for output files
                   ))

Again, we investigate the output of the returned list:

# Look at output list from modGBarea()
names(tree4)
output
## [1] "est"      "pse"      "titlelst" "raw"      "statecd"  "states"   "invyr"
# Estimate and percent sampling error of estimate
tree4$est
output
##                        Forest type           Large diameter
## 1                      Douglas-fir    13,220,807.8 (110.84)
## 2                 Engelmann spruce   280,813,787.4 ( 56.81)
## 3 Engelmann spruce / subalpine fir   258,361,837.5 ( 46.33)
## 4                    Subalpine fir    64,151,931.3 ( 74.52)
## 5                   Lodgepole pine   843,091,898.5 ( 23.55)
## 6                            Aspen              -- (    --)
## 7                       Nonstocked              -- (    --)
## 8                            Total 1,459,640,262.5 ( 14.80)
##          Medium diameter        Small diameter  Nonstocked
## 1            -- (    --)  3,232,360.3 (162.26) -- (    --)
## 2  91,643,840.9 (115.58)           -- (    --) -- (    --)
## 3  19,870,297.1 ( 73.46)  6,039,623.3 ( 88.17) -- (    --)
## 4            -- (    --)           -- (    --) -- (    --)
## 5 423,496,333.8 ( 28.44) 11,122,841.6 ( 61.94) -- (    --)
## 6            -- (    --)           -- (    --) -- (    --)
## 7            -- (    --)           -- (    --) -- (    --)
## 8 535,010,471.8 ( 26.77) 20,394,825.1 ( 45.99) -- (    --)
##                      Total
## 1    16,453,168.1 ( 91.71)
## 2   372,457,628.3 ( 50.51)
## 3   284,271,757.8 ( 41.67)
## 4    64,151,931.3 ( 74.52)
## 5 1,277,711,073.9 ( 16.98)
## 6              -- (    --)
## 7              -- (    --)
## 8 2,015,045,559.4 ( 10.67)
## Raw data (list object) for estimate
raw4 <- tree4$raw      # extract raw data list object from output
names(raw4)
output
##  [1] "unit_totest"   "unit_rowest"   "unit_colest"   "unit_grpest"  
##  [5] "domdat"        "plotweights"   "estvar"        "estvar.filter"
##  [9] "module"        "esttype"       "MAmethod"      "predselectlst"
## [13] "rowvar"        "colvar"        "areaunits"     "estunits"
head(raw4$unit_totest)   # estimates by estimation unit (i.e., ESTN_UNIT)
output
##   ONEUNIT    nhat nhat.var NBRPLT NBRPLT.gt0 AREAUSED        est      est.var
## 1       1 1811.42  37356.8     37         34  1112412 2015045559 4.622759e+16
##      est.se    est.cv      pse   CI99left  CI99right   CI95left  CI95right
## 1 215006029 0.1067003 10.67003 1461226728 2568864391 1593641485 2436449634
##     CI68left  CI68right
## 1 1801231118 2228860000
head(raw4$unit_rowest)   # estimates by row, by estimation unit (i.e., ESTN_UNIT)
output
##   ONEUNIT FORTYPCD       nhat   nhat.var NBRPLT NBRPLT.gt0
## 1       1      201   14.79053   183.9783     37          2
## 2       1      265  334.81975 28597.8813     37          4
## 3       1      266  255.54531 11338.6666     37          5
## 4       1      268   57.66920  1847.0547     37          2
## 5       1      281 1148.59483 38016.6026     37         23
## 6       1      901    0.00000     0.0000     37          0
##                        Forest type AREAUSED        est      est.var    est.se
## 1                      Douglas-fir  1112412   16453168 2.276660e+14  15088604
## 2                 Engelmann spruce  1112412  372457628 3.538877e+16 188119031
## 3 Engelmann spruce / subalpine fir  1112412  284271758 1.403116e+16 118453199
## 4                    Subalpine fir  1112412   64151931 2.285659e+15  47808562
## 5                   Lodgepole pine  1112412 1277711074 4.704407e+16 216896455
## 6                            Aspen  1112412          0 0.000000e+00         0
##      est.cv      pse  CI99left  CI99right  CI95left  CI95right   CI68left
## 1 0.9170637 91.70637         0   55318835         0   46026287    1448187
## 2 0.5050750 50.50750         0  857020140   3751103  741164153  185381175
## 3 0.4166900 41.66900         0  589386980  52107753  516435763  166475040
## 4 0.7452396 74.52396         0  187298626         0  157854990   16608330
## 5 0.1697539 16.97539 719022828 1836399319 852601833 1702820315 1062016684
## 6       NaN      NaN         0          0         0          0          0
##    CI68right
## 1   31458149
## 2  559534081
## 3  402068476
## 4  111695532
## 5 1493405464
## 6          0
head(raw4$unit_colest)   # estimates by column, by estimation unit (i.e., ESTN_UNIT)
output
##   ONEUNIT STDSZCD       nhat    nhat.var NBRPLT NBRPLT.gt0 Stand-size class
## 1       1       1 1312.13957 37720.24765     37         18   Large diameter
## 2       1       2  480.94618 16570.36181     37         14  Medium diameter
## 3       1       3   18.33387    71.08256     37          4   Small diameter
## 4       1       5    0.00000     0.00000     37          0       Nonstocked
##   AREAUSED        est      est.var    est.se    est.cv      pse  CI99left
## 1  1112412 1459640263 4.667734e+16 216049403 0.1480155 14.80155 903133879
## 2  1112412  535010472 2.050518e+16 143196301 0.2676514 26.76514 166161244
## 3  1112412   20394825 8.796191e+13   9378801 0.4598618 45.98618         0
## 4  1112412          0 0.000000e+00         0       NaN      NaN         0
##    CI99right   CI95left  CI95right   CI68left  CI68right
## 1 2016146646 1036191214 1883089311 1244788231 1674492295
## 2  903859699  254350880  815670064  392607782  677413162
## 3   44553016    2012713   38776937   11068003   29721648
## 4          0          0          0          0          0
head(raw4$unit_grpest)   # estimates by row and column, by estimation unit (i.e., ESTN_UNIT)
output
##   ONEUNIT grpvar       nhat    nhat.var NBRPLT NBRPLT.gt0 FORTYPCD STDSZCD
## 1       1  201#1  11.884809   173.51852     37          1      201       1
## 2       1  201#3   2.905721    22.22926     37          1      201       3
## 3       1  265#1 252.436776 20564.47714     37          3      265       1
## 4       1  265#2  82.382977  9067.00974     37          1      265       2
## 5       1  266#1 232.253657 11575.99347     37          3      266       1
## 6       1  266#2  17.862348   172.20105     37          1      266       2
##   Stand-size class                      Forest type AREAUSED       est
## 1   Large diameter                      Douglas-fir  1112412  13220808
## 2   Small diameter                      Douglas-fir  1112412   3232360
## 3   Large diameter                 Engelmann spruce  1112412 280813787
## 4  Medium diameter                 Engelmann spruce  1112412  91643841
## 5   Large diameter Engelmann spruce / subalpine fir  1112412 258361838
## 6  Medium diameter Engelmann spruce / subalpine fir  1112412  19870297
##        est.var    est.se    est.cv       pse CI99left CI99right CI95left
## 1 2.147224e+14  14653411 1.1083597 110.83597        0  50965492        0
## 2 2.750785e+13   5244793 1.6225891 162.25891        0  16742051        0
## 3 2.544774e+16 159523489 0.5680757  56.80757        0 691719064        0
## 4 1.122007e+16 105924847 1.1558316 115.58316        0 364488165        0
## 5 1.432484e+16 119686437 0.4632512  46.32512        0 566653670 23780731
## 6 2.130921e+14  14597675 0.7346481  73.46481        0  57471417        0
##   CI95right  CI68left CI68right
## 1  41940965         0  27793007
## 2  13511965         0   8448086
## 3 593474080 122174397 439453178
## 4 299252726         0 196981640
## 5 492942944 139338716 377384959
## 6  48481215   5353524  34387070
# Titles (list object) for estimate
titlelst4 <- tree4$titlelst
names(titlelst4)
output
##  [1] "title.estpse"  "title.yvar"    "title.estvar"  "title.unitvar"
##  [5] "title.ref"     "outfn.estpse"  "outfn.rawdat"  "outfn.param"  
##  [9] "title.rowvar"  "title.row"     "title.colvar"  "title.col"    
## [13] "title.unit"
output
## $title.estpse
## [1] "Net merchantable bole  wood volume of live trees (timber species at least 5 inch dia), in cubic feet (percent sampling error), by forest type and stand-size class on forest land"
## 
## $title.yvar
## [1] "Net volume, in cubic feet"
## 
## $title.estvar
## [1] "Net merchantable bole  wood volume of live trees (timber species at least 5 inch dia)"
## 
## $title.unitvar
## [1] "ONEUNIT"
## 
## $title.ref
## [1] "Wyoming, 2011-2013"
## 
## $outfn.estpse
## [1] "WY_tree_VOLCFNET_FORTYPCD_STDSZCD_forestland"
## 
## $outfn.rawdat
## [1] "WY_tree_VOLCFNET_FORTYPCD_STDSZCD_forestland_rawdata"
## 
## $outfn.param
## [1] "WY_tree_VOLCFNET_FORTYPCD_STDSZCD_forestland_parameters"
## 
## $title.rowvar
## [1] "Forest type"
## 
## $title.row
## [1] "Net merchantable bole  wood volume of live trees (timber species at least 5 inch dia), in cubic feet (percent sampling error), by forest type on forest land; Wyoming, 2011-2013"
## 
## $title.colvar
## [1] "Stand-size class"
## 
## $title.col
## [1] "Net merchantable bole  wood volume of live trees (timber species at least 5 inch dia), in cubic feet (percent sampling error), by stand-size class on forest land; Wyoming, 2011-2013"
## 
## $title.unit
## [1] "cubic feet"
# List output files in outfolder
list.files(outfolder, pattern = "WY_tree")
output
## [1] "WY_tree_VOLCFNET_FORTYPCD_STDSZCD_forestland_modMA_mase_greg.csv"
output
## [1] "WY_tree_VOLCFNET_FORTYPCD_STDSZCD_forestland_rawdata_modMA_mase_greg_domdat.csv"     
## [2] "WY_tree_VOLCFNET_FORTYPCD_STDSZCD_forestland_rawdata_modMA_mase_greg_plotweights.csv"
## [3] "WY_tree_VOLCFNET_FORTYPCD_STDSZCD_forestland_rawdata_modMA_mase_greg_unit_colest.csv"
## [4] "WY_tree_VOLCFNET_FORTYPCD_STDSZCD_forestland_rawdata_modMA_mase_greg_unit_grpest.csv"
## [5] "WY_tree_VOLCFNET_FORTYPCD_STDSZCD_forestland_rawdata_modMA_mase_greg_unit_rowest.csv"
## [6] "WY_tree_VOLCFNET_FORTYPCD_STDSZCD_forestland_rawdata_modMA_mase_greg_unit_totest.csv"

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4