Biometry, Statistics & Computing for Forestry

Forestry & Forest Sciences · Foundations · also Forest Biometry, Statistical Methods, Statistics and Computer Applications

10units
10chapters
6,538words
90practice questions

The statistics and computing used in forest inventory, experiments and modelling, from descriptive statistics and sampling to regression, designed experiments and scripting. Econometrics and business statistics are taught in the Agribusiness track, and sampling theory and spatial statistics in full in the Agricultural Statistics track; they are not repeated.

In the exams: ICAR AIEEA-PG Group 09 Unit I (elements of statistics); background to all mensuration and inventory questions

Syllabus

  1. Descriptive statistics, frequency distributions and diameter distributions
  2. Probability and the binomial, Poisson and normal distributions
  3. Sampling distributions, standard error and confidence intervals
  4. Tests of significance: z, t, F and chi-square
  5. Correlation and simple and multiple linear regression
  6. Non-linear regression for tree allometry
  7. Analysis of variance and basic experimental designs (CRD, RBD, Latin square)
  8. Spreadsheets for field data
  9. Introduction to R or Python for forest data
  10. Data quality, field data recording and databases

Study manual

Biometry is the application of statistics to biological measurement, and in forestry it is the toolkit behind every inventory, growth model, experiment and carbon estimate. A forester who reports that a stand holds 250 cubic metres per hectare, plus or minus 8 percent, or that a fertiliser increased height growth significantly, or that biomass can be predicted from diameter by a power equation, is using biometry. The questions are always the same: how to summarise many measurements, how much to trust an estimate made from a sample, whether a difference is real or due to chance, and how to describe the relation between variables that are easy to measure, such as diameter, and those that are not, such as volume or biomass.

This manual covers descriptive statistics and the frequency and diameter distributions of forest stands; probability and the binomial, Poisson and normal distributions; sampling distributions, standard errors, confidence intervals and the sample-size formula used in inventory; tests of significance with z, t, F and chi-square; correlation and simple and multiple linear regression, including volume equations; non-linear regression for tree allometry; analysis of variance with the completely randomised, randomised block and Latin square designs; and the computing side: spreadsheets for field data, an introduction to R and Python for forest data, and data quality, field recording and databases.

Sampling theory, spatial statistics and advanced experimental design are developed in the Agricultural Statistics track and in the forestry research methods and inventory subjects of this track; here the aim is to give every forestry student and practitioner a working command of the methods they meet weekly, with forest examples and the arithmetic done by hand once so that software output can be read with understanding.

Examinations test this subject through definitions and through calculation: mean, variance, standard deviation, coefficient of variation and quadratic mean diameter; binomial, Poisson and normal probabilities; standard error, confidence limits and required number of plots; t, F and chi-square statistics and their degrees of freedom; regression slopes, R² and predictions from volume and biomass equations; correction of log-transformed predictions; and ANOVA tables. Postgraduate forestry entrance examinations include elements of statistics, and the same skills underlie mensuration and inventory questions in civil-service, licensure and professional examinations worldwide.

1. 1. Descriptive statistics and diameter distributions

Measures of location, spread and shape

Descriptive statistics summarise a set of observations. Measures of location describe the centre. The arithmetic mean is the sum of values divided by their number; the median is the middle value when values are ranked, resistant to extreme values; the mode is the most frequent value or class. For tree diameters the mean diameter is less useful than the quadratic mean diameter, Dq = √(Σd²/n), the diameter of the tree of average basal area, because volume and basal area depend on diameter squared; for diameters of 20, 30 and 40 cm, the arithmetic mean is 30 cm but Dq is √(2900/3) ≈ 31.1 cm, and Dq always equals or exceeds the arithmetic mean. Measures of spread describe variability. The range is the difference between largest and smallest values. The sample variance is s² = Σ(x − x̄)²/(n − 1), with n − 1 degrees of freedom because one degree of freedom is used in estimating the mean; the standard deviation s is its square root, in the units of the data. The coefficient of variation, CV = s/x̄ × 100, expresses spread relative to the mean and allows comparison between variables or stands with different means; plot volumes in natural forests commonly have CVs of 30 to 60 percent or more, plantations lower. Percentiles and the interquartile range describe spread without assuming symmetry. Shape is described by skewness (asymmetry: positive skew has a long right tail, common in tree sizes and biomass) and kurtosis (peakedness relative to the normal distribution). For data in frequency classes, such as diameter classes of 5 cm, the mean is estimated from class midpoints weighted by frequencies, and the class width should be chosen so that the histogram shows the pattern without too much noise; a common starting point is 5 to 15 classes. Calculations by hand: for heights of 12, 15, 18, 15 and 20 m, the mean is 16 m, deviations are −4, −1, 2, −1 and 4, the sum of squares is 38, the variance 38/4 = 9.5 m², the standard deviation 3.08 m and the CV 19 percent.

Frequency and diameter distributions

A frequency distribution counts the number of observations in each class; plotted as a histogram it shows the pattern of the data. In forestry, the most important frequency distribution is the diameter distribution of a stand, the number of trees per hectare in each diameter class. It reflects stand history and structure and is used to plan thinning and harvesting, to estimate volume by class and to model growth. Even-aged stands, such as plantations and stands regenerated after a single disturbance, typically have unimodal, bell-shaped distributions, often slightly skewed, whose mean moves to larger diameters and whose spread widens with age; thinning from below removes the left tail. Uneven-aged stands, managed by selection or developed naturally with continuous regeneration, typically have a reverse-J (negative exponential) distribution, with many small trees and progressively fewer large ones. In the 1890s de Liocourt observed that in balanced uneven-aged stands the ratio of trees in successive diameter classes is roughly constant, the q-ratio, commonly between about 1.2 and 2 for 5 cm classes depending on species and objectives; a stand with 200 trees in the 10 cm class and q = 1.5 would have about 133 in the 15 cm class and 89 in the 20 cm class. Foresters use target q-ratios, maximum diameters and residual basal areas to guide selection cutting. Mathematical distributions are fitted to diameter data to summarise and predict them. The Weibull distribution, with two or three parameters (location, scale and shape), is the most widely used because it is flexible enough to describe both reverse-J shapes (shape parameter below 1) and bell shapes (shape above about 3.6 it is close to normal), and its cumulative form is easily computed; the gamma, beta, log-normal and Johnson's SB distributions are also used. Parameter-prediction and parameter-recovery methods link distribution parameters to stand variables such as age, site index and density, so that growth models can predict diameter distributions in future.

Remember

2. 2. Probability and the binomial, Poisson and normal distributions

Probability rules

Probability measures how likely an event is, from 0 (impossible) to 1 (certain). For equally likely outcomes it is the number of favourable outcomes divided by the total; in practice it is often estimated from relative frequencies in long runs of observations, such as the proportion of seedlings that survive. The addition rule gives the probability that A or B occurs: P(A or B) = P(A) + P(B) − P(A and B), which reduces to P(A) + P(B) for mutually exclusive events. The multiplication rule gives the probability that both occur: P(A and B) = P(A) × P(B | A), which reduces to P(A) × P(B) when events are independent. The complement rule, P(not A) = 1 − P(A), is often the easiest route: if each of three independent fire lookouts misses a fire with probability 0.2, the probability that at least one sees it is 1 − 0.2³ = 0.992. Conditional probability, P(A | B), is the probability of A given that B has occurred; Bayes' theorem reverses conditioning and is used, for example, to interpret diagnostic tests for tree diseases, where a positive result in a rare disease may still be more likely a false alarm than a true case. Random variables take numerical values according to probability distributions, which can be discrete (counts such as trees per plot or surviving seedlings) or continuous (measurements such as diameter or height). The expected value of a random variable is its long-run mean, and its variance measures spread around that mean. Probability underlies all of statistics: sampling designs give each unit a known probability of selection, which allows estimates and their errors to be calculated, and tests of significance ask how probable an observed result would be if there were no real effect.

Binomial, Poisson and normal distributions

The binomial distribution describes the number of successes x in n independent trials, each with the same probability p of success: P(x) = C(n, x) p^x (1 − p)^(n − x), with mean np and variance np(1 − p). If seedling survival is 0.8 and ten seedlings are planted in a row, the probability that all ten survive is 0.8¹⁰ ≈ 0.107, and the expected number surviving is 8 with variance 1.6. It is used for survival, germination, infection and presence–absence data. The Poisson distribution describes counts of rare, independent events in a fixed area or time when the mean count λ is known: P(x) = e^(−λ) λ^x / x!, with mean and variance both equal to λ. If seedlings of a species are randomly scattered with a mean of 2 per quadrat, the probability that a quadrat has none is e^(−2) ≈ 0.135 and the probability of exactly one is 2e^(−2) ≈ 0.271. Because the Poisson distribution is the model for a random spatial pattern, comparing the variance and mean of quadrat counts tests for pattern: a variance-to-mean ratio near 1 suggests randomness, above 1 clumping, below 1 regularity. The normal distribution is the continuous, symmetrical, bell-shaped distribution defined by its mean μ and standard deviation σ; about 68 percent of values lie within one standard deviation of the mean, 95 percent within 1.96 and 99.7 percent within three. Any normal value is converted to a standard normal value z = (x − μ)/σ, whose probabilities are tabulated: if tree heights in a plantation are normal with mean 20 m and standard deviation 2 m, a tree of 23 m has z = 1.5, and about 6.7 percent of trees are taller. Many biological measurements are approximately normal, and by the central limit theorem the means of reasonably large samples are approximately normal whatever the distribution of individual values, which is why the normal distribution underlies confidence intervals and many tests. Binomial and Poisson distributions can be approximated by the normal when np and n(1 − p), or λ, are large.

Remember

3. 3. Sampling distributions, standard error and confidence intervals

Standard error and the finite population correction

A sample mean varies from sample to sample; its distribution over all possible samples is the sampling distribution, whose standard deviation is the standard error (SE). For simple random sampling, SE of the mean = s/√n, where s is the sample standard deviation and n the number of sample units; it decreases with the square root of sample size, so quadrupling the number of plots halves the standard error. When the sample is a substantial fraction of a finite population, the standard error is multiplied by the finite population correction, √(1 − n/N), where N is the number of possible units; with 20 plots out of a population of 1000 possible plots, the correction is √0.98 ≈ 0.99 and can be ignored, but in a small woodlot where 30 of 100 possible plots are measured it reduces SE noticeably. The relative standard error, SE as a percentage of the mean, is often called sampling error percent in inventory reports. Standard errors of totals are the standard error of the mean multiplied by the number of units in the population (or the area, when the mean is per hectare). In a forest of 500 ha with mean volume 200 m³ ha⁻¹ and SE 10 m³ ha⁻¹, total volume is 100,000 m³ with SE 5000 m³. Stratified sampling, which divides the forest into more homogeneous strata and samples each, usually gives smaller standard errors than simple random sampling with the same number of plots; systematic sampling on a grid, the commonest design in forest inventory, is usually analysed as if random, which tends to overstate the error slightly. Different sampling designs and their estimators are treated in the inventory subject; the logic of standard errors is the same in all of them.

Confidence intervals and sample size

A confidence interval gives a range likely to contain the true population value: mean ± t × SE, where t is the value of Student's t distribution for the chosen confidence level and n − 1 degrees of freedom. For large samples t approaches the normal value of 1.96 for 95 percent confidence; for small samples it is larger: about 2.26 for 9 degrees of freedom and 2.06 for 24. With 10 plots giving a mean of 180 m³ ha⁻¹ and standard deviation 45 m³ ha⁻¹, SE = 45/√10 = 14.2, and the 95 percent confidence interval is 180 ± 2.26 × 14.2, or about 148 to 212 m³ ha⁻¹. The interpretation is that if sampling were repeated many times, 95 percent of such intervals would contain the true mean; it is not that the true mean has a 95 percent chance of lying in this particular interval, although that informal reading is common. Inventory planning reverses the calculation to find the number of plots needed for a target precision. If the coefficient of variation is CV percent and the allowable error is E percent of the mean at a chosen confidence level, the required number of plots for simple random sampling of a large population is n = t² CV² / E². With CV = 40 percent, E = 10 percent and t ≈ 2 for 95 percent confidence, n = 4 × 1600 / 100 = 64 plots. Because t depends on n, the calculation is iterated for small samples, and for small populations the result is adjusted with the finite population correction. The formula shows the levers: halving the allowable error quadruples the number of plots, and reducing CV by stratification or by better plot design (larger plots usually have lower CV) reduces the work. CV is estimated from previous inventories or a pilot sample. Cost matters as much as precision, and optimal designs minimise the cost of achieving a required precision.

Remember

4. 4. Tests of significance: z, t, F and chi-square

Logic of testing and the z and t tests

A test of significance asks whether an observed difference or relation could plausibly have arisen by chance. A null hypothesis (H₀) states no effect, for example that two seed sources have the same mean height; the alternative (H₁) states an effect. A test statistic measures how far the data depart from H₀ in units of standard error, and its sampling distribution under H₀ gives the p-value, the probability of a result at least as extreme. If p is below the significance level α (commonly 0.05), H₀ is rejected. Rejecting a true H₀ is a Type I error (probability α); failing to reject a false H₀ is a Type II error (probability β), and power, 1 − β, increases with sample size, effect size and lower variability. A two-tailed test looks for a difference in either direction; a one-tailed test for a difference in a stated direction, decided before seeing the data. Significance is not importance: with very large samples, trivial differences become significant, so effect sizes and confidence intervals should be reported. The z test applies when the population standard deviation is known or samples are large. The t test, developed by W.S. Gosset writing as 'Student', applies when σ is estimated from small samples. The one-sample t test compares a mean with a hypothesised value: t = (x̄ − μ₀)/(s/√n), with n − 1 degrees of freedom. The two-sample t test compares means of two independent groups, using a pooled variance if variances are similar, with n₁ + n₂ − 2 degrees of freedom, or Welch's version if they are not. The paired t test analyses differences within pairs, such as the same trees measured before and after fertilising, or two treatments applied to adjacent plots, with n − 1 degrees of freedom for n pairs; pairing removes variation between pairs and is more powerful when pairs are well matched.

F and chi-square tests

The F test compares two variances: F = s₁²/s₂², with the larger variance in the numerator for a two-tailed comparison, and degrees of freedom n₁ − 1 and n₂ − 1. It is used to check whether two groups have similar variability (an assumption of the pooled t test) and, most importantly, in analysis of variance and regression, where F compares the variance explained by treatments or predictors with the residual variance. If two nurseries produce seedling heights with variances 16 and 4 cm², F = 4 on the appropriate degrees of freedom. The chi-square (χ²) test compares observed frequencies with frequencies expected under a hypothesis: χ² = Σ(O − E)²/E. In a goodness-of-fit test, observed counts are compared with those expected from a theoretical distribution or ratio; degrees of freedom are the number of classes minus one minus the number of parameters estimated from the data. For example, if 100 seeds are expected to germinate in a 3:1 ratio of normal to albino seedlings and 70 normal and 30 albino are observed, χ² = (70 − 75)²/75 + (30 − 25)²/25 = 0.33 + 1.00 = 1.33 with 1 degree of freedom, well below the 5 percent critical value of 3.84, so the data fit the ratio. In a contingency-table test of independence, for example between species and the presence of a disease, expected frequencies are row total × column total / grand total, and degrees of freedom are (rows − 1)(columns − 1). Chi-square tests require expected frequencies that are not too small (a common rule is at least 5 in most cells); small tables use exact tests. Non-parametric tests, such as the Mann–Whitney, Wilcoxon signed-rank and Kruskal–Wallis tests, compare groups using ranks and make fewer distributional assumptions, at some cost in power when data are normal. Multiple testing inflates the chance of false positives, and corrections such as Bonferroni's divide α by the number of tests.

Remember

5. 5. Correlation and linear regression

Correlation and simple linear regression

Correlation measures the strength and direction of a linear relation between two variables. Pearson's correlation coefficient r = Sxy / √(Sxx Syy), where Sxy = Σ(x − x̄)(y − ȳ) and Sxx and Syy are the sums of squares, ranges from −1 to +1; values near zero mean no linear relation, though a strong curved relation can still exist. Spearman's rank correlation applies the same formula to ranks and is robust to outliers and monotonic non-linearity. Correlation does not imply causation, and r is tested against zero with t = r√(n − 2)/√(1 − r²) on n − 2 degrees of freedom. Regression describes how a response variable y changes with a predictor x and allows prediction. Simple linear regression fits y = a + bx by least squares, minimising the sum of squared vertical deviations: the slope b = Sxy/Sxx and intercept a = ȳ − bx̄. For example, with heights (y) and diameters (x) giving Sxy = 300, Sxx = 600, x̄ = 25 cm and ȳ = 20 m, b = 0.5 m per cm and a = 20 − 0.5 × 25 = 7.5 m, so a 30 cm tree is predicted to be 22.5 m tall. The coefficient of determination R², the proportion of the variance of y explained by the regression, equals r² in simple regression. The standard error of the estimate (root mean square error) measures the typical size of residuals in the units of y. Regression assumes a correct (linear) form, independent errors, constant variance of errors (homoscedasticity) and, for tests and intervals, normally distributed errors. Residual plots, residuals against fitted values and predictors, reveal curvature, outliers and heteroscedasticity, a frequent problem in forestry because the variability of volume and biomass increases with tree size. A confidence interval for the mean response is narrower than a prediction interval for a single new tree, and both widen away from the mean of x; extrapolation beyond the range of data used to fit the equation is risky.

Multiple regression and volume equations

Multiple linear regression relates y to several predictors: y = b₀ + b₁x₁ + b₂x₂ + …, fitted by least squares, with each coefficient measuring the change in y per unit change in that predictor when the others are held constant. Adjusted R² penalises additional predictors, and F tests assess the whole model and partial F or t tests individual coefficients. Multicollinearity, strong correlation among predictors, makes coefficients unstable and hard to interpret, although predictions may still be good; it is common when diameter, basal area and height are all used together. Variables may be transformed, combined or represented by indicator (dummy) variables for categories such as species or site class. Model selection balances fit and simplicity, using adjusted R², the standard error of the estimate, information criteria such as AIC, and above all validation on independent data. Tree volume equations are the classic forestry application. The combined-variable equation, V = b₀ + b₁D²H, uses the product of squared diameter and height, proportional to the volume of a cylinder, as a single predictor and is linear in its coefficients. The Schumacher–Hall equation, V = a D^b H^c, is non-linear but becomes linear after logarithms: ln V = ln a + b ln D + c ln H. Local volume tables use diameter alone, standard (general) tables use diameter and height, and form-class tables add a measure of stem form. Volume equations are fitted from felled or precisely measured sample trees, with volumes from sectional measurements by Smalian's or Huber's formula; the sample must span the range of sizes and conditions to which the equation will be applied. Weighted regression, with weights inversely proportional to the variance (often to (D²H)²), is used to deal with heteroscedasticity in the combined-variable equation. Height–diameter equations, used to predict heights of trees whose diameters were measured but heights were not, are another routine application, usually non-linear.

Remember

6. 6. Non-linear regression for tree allometry

Allometric models and log transformation

Allometry is the relation between the size of one part of an organism and another, or the whole. In trees, biomass, volume, crown area and leaf area scale non-linearly with stem diameter, usually as a power function: y = a D^b. On log–log axes this becomes a straight line, ln y = ln a + b ln D, which can be fitted by ordinary linear regression. For above-ground biomass the exponent b is commonly between about 2 and 3, because mass depends on diameter squared times height, and height increases with diameter at a decreasing rate. Including height and wood density improves biomass predictions across species and sites; the widely used pan-tropical equations of Chave and colleagues express above-ground biomass as a function of the product of wood density, squared diameter and height. Log transformation has two benefits: it linearises the power model and usually stabilises the variance, since the multiplicative errors common in allometric data become additive on the log scale. It has a cost: back-transforming a prediction from the log scale gives an estimate of the median, not the mean, so predictions are biased low. The standard correction multiplies the back-transformed prediction by a correction factor, CF = exp(SEE²/2), where SEE is the standard error of the estimate of the regression on the natural-log scale (Baskerville, 1972; Sprugel, 1983). With SEE = 0.3, CF = exp(0.045) ≈ 1.046, a 4.6 percent upward adjustment; ignoring it systematically underestimates biomass and carbon stocks. Logarithms to base 10 need the equivalent correction with a factor of 2.303² in the exponent. For example, if ln B = −2.0 + 2.4 ln D, a tree of 30 cm diameter has ln B = −2.0 + 2.4 × 3.401 = 6.163, so B ≈ 475 kg before correction and about 497 kg after correction with CF 1.046.

Non-linear least squares and growth functions

Some allometric and growth relations cannot be linearised, or are better fitted on their original scale, using non-linear least squares. Software finds coefficients that minimise the sum of squared residuals by iterative algorithms, such as Gauss–Newton or Levenberg–Marquardt, starting from initial values supplied by the user; poor starting values can lead to failure to converge or to a local rather than global minimum, so good starting values from plots, logarithmic fits or published equations are important. Fitting y = aD^b directly by non-linear least squares assumes additive errors of constant variance, which rarely holds; weighting, or modelling the variance as a power of D, is usually needed. Comparing a log-linear fit with a non-linear fit is a matter of the error structure, and residual plots on the original scale decide which assumption is closer. Growth over time is described by sigmoid functions. The Chapman–Richards function, y = A(1 − e^(−kt))^c, where A is the asymptote, k the rate and c the shape parameter, is the most widely used for height, diameter and stand volume growth and for site index curves; the logistic, Gompertz and Weibull-type functions are alternatives. Their first derivative gives current annual increment and their mean over time gives mean annual increment, linking to rotation decisions. Height–diameter models such as the Näslund function and exponential and power forms are used to fill in missing heights. Mixed-effects versions of these models, with random effects for plots or sites, are increasingly standard because forest data are grouped; they are introduced in the research methods subject. Finally, any allometric equation is valid only within the range of sizes, species, sites and measurement methods used to fit it: applying a plantation equation to old natural forest trees, or a local equation to another country, can give large errors, which is a major source of uncertainty in biomass and carbon estimates.

Remember

7. 7. Analysis of variance and basic experimental designs

Analysis of variance and the completely randomised design

Analysis of variance (ANOVA), developed by R.A. Fisher, partitions the total variation in a set of observations into parts attributable to different sources, and tests whether treatment means differ by comparing the variance between treatments with the variance within them. The completely randomised design (CRD) assigns t treatments at random to experimental units, with r replicates each. Total sum of squares (SS) is Σ(y − ȳ)² over all observations, with tr − 1 degrees of freedom; treatment SS is r Σ(treatment mean − grand mean)², with t − 1 degrees of freedom; error SS is the remainder, with t(r − 1) degrees of freedom. Mean squares are SS divided by degrees of freedom, and F = treatment mean square / error mean square, compared with the F distribution. For 4 seed sources with 5 replicate plots each, total df = 19, treatment df = 3 and error df = 16; if treatment MS = 30 and error MS = 6, F = 5.0, which exceeds the 5 percent critical value of about 3.24 for 3 and 16 df, so at least one mean differs. The CRD is simple and flexible but is efficient only when experimental units are homogeneous, as in nurseries, greenhouses and laboratories. ANOVA assumes independent errors, equal variances across treatments and approximately normal errors; transformations such as square root for counts, arcsine or logit for proportions and logarithms for data whose variance increases with the mean help meet these assumptions. A significant F says only that the means are not all equal; comparisons among means use the least significant difference (LSD = t × √(2 × error MS / r)), Tukey's honestly significant difference, Duncan's multiple range test or planned contrasts, with the caution that many unplanned comparisons inflate Type I error. The coefficient of variation of the experiment, √(error MS) / grand mean × 100, indicates experimental precision.

Randomised block and Latin square designs

Field sites are rarely uniform: slope, soil depth, drainage and previous land use change across a site. The randomised block design (RBD, or randomised complete block design) groups experimental units into blocks that are as uniform as possible, such as plots along the same contour, and applies every treatment once in each block, randomised independently within each block. Block differences are removed from the error: the ANOVA has block SS with r − 1 degrees of freedom (r blocks), treatment SS with t − 1, and error SS with (t − 1)(r − 1). With 5 treatments in 4 blocks, total df is 19, blocks 3, treatments 4 and error 12. Blocking pays when blocks differ substantially; its efficiency relative to a CRD can be estimated from the ANOVA, and blocks should be arranged perpendicular to the main gradient, with plots long in the direction of the gradient within blocks. The Latin square design controls two sources of variation at once, rows and columns, for example a slope in one direction and a soil gradient in the other: with t treatments, t rows and t columns, each treatment appears once in every row and every column. Its ANOVA has rows, columns and treatments each with t − 1 degrees of freedom and error with (t − 1)(t − 2): for a 5 × 5 square, total df 24, error df 12. Latin squares need as many replicates as treatments, which limits them to about 4 to 8 treatments, and assume no interactions between rows, columns and treatments. Missing plots, common in long-term forestry trials where trees die or plots are damaged, can be estimated by standard formulae for small numbers or, better, handled by fitting linear or mixed models to unbalanced data. Factorial treatment structures, split-plot designs for factors applied at different scales, and incomplete block designs for large numbers of genotypes in tree breeding are developed in the forestry research methods subject.

Remember

8. 8. Spreadsheets for field data

Organising field data in spreadsheets

Spreadsheets are the most common tool for entering, checking and summarising forest field data, and they work well when the data are organised consistently. The most important principle is a tidy layout: each variable in its own column, each observation in its own row, and each type of observational unit in its own table or sheet. For a tree inventory this means one row per tree per measurement occasion, with columns for plot identifier, tree number, species code, diameter, height and condition codes, rather than a layout that spreads trees across columns or mixes plot summaries with tree records. Plot-level information (location, date, slope, stand type) belongs in a separate plot table linked by the plot identifier. Column headings should be short, unique, without spaces or special characters, and include units (for example dbh_cm, height_m). Each cell should contain a single value: no merged cells, no notes typed into numeric columns, no colour used as the only record of information, and a consistent code (such as NA or an empty cell, as documented) for missing data, never zero, which would be taken as a real measurement. Dates should be entered in an unambiguous international format, year-month-day, because spreadsheets reinterpret dates and some codes automatically. Data validation rules restrict entries to allowed species codes or plausible ranges (for example diameter between 5 and 200 cm) and catch many errors at entry. The raw data sheet should never be edited by hand once checked; calculations and summaries belong on separate sheets or, better, in scripts, so that the original data are preserved and every derived number can be traced.

Calculations, summaries and limits

Spreadsheet formulas perform routine forestry calculations: basal area of a tree from diameter in centimetres is π × (D/200)² square metres, so a 40 cm tree has 0.1257 m²; plot values are summed and multiplied by an expansion factor (10,000 divided by the plot area in square metres) to give per-hectare values, so a 0.04 ha plot has an expansion factor of 25. Lookup functions attach species names, wood densities or volume equation coefficients from a reference table to each tree record by species code, avoiding retyping. Pivot tables summarise data by any combination of categories, such as number of trees and basal area per hectare by species and diameter class for each stratum, and charts display diameter distributions and height–diameter relations for checking. Built-in functions compute means, standard deviations, regression coefficients and t tests, and add-in tools perform simple ANOVA. Spreadsheets have well-documented weaknesses. Formulas are hidden in cells and easily overwritten or copied with incorrect references; errors in a single cell can propagate unnoticed, and audits of real spreadsheets in business and science have repeatedly found errors in a large share of them. Sorting one column without the others scrambles records. Automatic conversion can silently change values, such as codes that look like dates. Large datasets become slow, and repeated analyses must be redone by hand each time data change, which is error-prone and hard to document. Good practice therefore includes keeping raw data read-only, documenting formulas and assumptions in a separate sheet, using named ranges and consistent formulas, checking totals by independent calculation, saving versions with dates, and moving analysis to a scripting language once it becomes complex or must be repeated, while continuing to use spreadsheets for data entry and quick inspection.

Remember

9. 9. Introduction to R or Python for forest data

Why scripts, and the basics

A script is a text file of instructions that reads data, processes and analyses it, and writes results and graphs. Scripted analysis is reproducible (anyone can rerun it and get the same results), transparent (every step is visible), reusable (next year's inventory runs through the same code) and scalable (thousands of plots are no harder than ten). The two languages most used in forest science are R, a free statistical language with thousands of contributed packages, including many written for forestry, ecology and spatial analysis, and Python, a free general-purpose language with libraries for data handling, statistics, machine learning and geospatial work. Both are open source and run on all major operating systems, and both can be used through an integrated development environment or interactive notebooks that combine code, output and explanatory text. Basic concepts are shared. Objects store data: numbers, text, vectors (sequences of values of one type) and data frames (tables in which columns are variables, the tidy format described earlier). Functions take inputs and return outputs: mean(x) in R, or x.mean() for a column in the pandas library in Python. Data are read from comma-separated text files, which are preferred to proprietary spreadsheet formats for archiving and exchange. In R, a typical first script reads a tree table with read.csv, computes basal area per tree with a vectorised expression such as ba <- pi * (dbh / 200)^2, summarises by plot with aggregate or with the dplyr package, and fits a regression with lm(height ~ dbh). In Python, pandas reads the file with read_csv, computes new columns in the same vectorised way, summarises with groupby and fits models with the statsmodels or scikit-learn libraries; numpy handles arrays and matplotlib draws graphs. Comments, marked with # in both languages, explain what the code does.

Typical forestry workflows and good practice

Common forestry tasks in R or Python include: computing tree and plot variables (basal area, volume from equations, biomass with allometric equations and correction factors, per-hectare expansion); summarising inventories by stratum with standard errors and confidence intervals; fitting height–diameter, volume and biomass equations with linear (lm in R, ols in statsmodels) and non-linear (nls in R, curve_fit in Python's scipy) regression; analysing experiments with ANOVA (aov or lm in R) and mixed models (packages such as lme4 or nlme in R and statsmodels in Python); plotting diameter distributions, height curves and residuals (ggplot2 in R, matplotlib or seaborn in Python); and processing spatial data, including GIS layers, rasters and LiDAR point clouds, with dedicated packages in both languages. Good practice makes scripts reliable. Keep raw data separate and never modify it in place; write scripts that start from raw data and produce every result. Use clear names for objects and files, and relative file paths within a project folder so that the project runs on another computer. Write small functions for repeated calculations, such as a volume equation, and test them on known cases. Check data on import (number of rows, ranges, missing values, unique codes) and assert expectations so that errors stop the script rather than producing wrong output silently. Record package versions, because results can change between versions, and use version control software to keep a history of changes and collaborate. Set a random seed when analyses involve random sampling or simulation so that results can be reproduced. Finally, publish code with data where possible, which many journals and funders now require. Learning to read and adapt short scripts is now a basic competence for foresters, and it supports the move from manual spreadsheet work to automated, auditable inventory and monitoring systems.

Remember

10. 10. Data quality, field data recording and databases

Field data recording and quality control

The value of every analysis depends on the quality of the data, and most errors in forest datasets arise in the field or during transcription, not in the statistics. Errors can be grouped as measurement errors (an incorrect diameter because the tape was not horizontal, a height measured from the wrong position, or an instrument out of calibration), recording errors (a correct measurement written wrongly, such as transposed digits, a decimal in the wrong place or an incorrect species code) and transcription or data-entry errors when field sheets are typed. Systematic errors, or bias, shift all measurements in one direction (a stretched tape, diameter measured at the wrong height) and are not reduced by larger samples; random errors scatter around the true value and average out. Prevention starts with written field protocols that define every variable precisely (breast height at 1.3 m above ground on the uphill side; how to measure forked, leaning and buttressed trees; codes for species, damage and status), standard forms with units printed, training and calibration exercises for crews, and regular instrument checks. Permanent plots need permanent tree tags and maps so that the same trees are remeasured and ingrowth and mortality are recorded correctly. Electronic data recorders and mobile apps with validation rules reject impossible values (a height of 300 m), enforce allowed codes and flag implausible changes from previous measurements (a tree that shrank by 5 cm), and they remove transcription. Independent check measurements on a random sample of plots, commonly 5 to 10 percent, by a separate crew quantify measurement error and are standard in national forest inventories. After collection, data are screened: range checks, frequency tables of codes, height–diameter plots that reveal outliers, comparisons with previous measurements, and checks for duplicate or missing records, with every correction documented.

Databases and data management

As datasets grow, especially long-term plots, inventories and research networks, relational databases replace spreadsheets. A relational database stores data in tables linked by keys. A plot table holds one row per plot with a unique plot identifier (the primary key) and plot attributes; a tree table holds one row per tree with a unique tree identifier and the plot identifier as a foreign key linking it to the plot; a measurement table holds one row per tree per measurement occasion, with tree identifier, date and measured values; and lookup tables hold species codes, equations and code definitions. This structure, the result of normalisation, avoids repeating the same information in many places, so that a plot's coordinates are stored once and cannot become inconsistent. Queries in Structured Query Language (SQL) select, join and summarise data, for example joining measurements to trees and plots to compute basal area per hectare by stratum and year. Databases enforce rules (allowed values, required fields, unique identifiers), support many simultaneous users and keep large datasets fast. Open-source database systems are widely used, and spatial extensions store plot locations and polygons for GIS analysis. Metadata, data about the data, describe what each table and field means, units, methods, coordinate reference systems, protocols and changes over time; without it, long-term data become uninterpretable when staff change. Backups in more than one location, access controls and version records protect data. Many funders and institutions require data management plans and the deposit of data in repositories with persistent identifiers, following principles that make data findable, accessible, interoperable and reusable. National forest inventories, long-term research plots and forest certification all depend on well-managed databases, and a forester who understands keys, tables and metadata can work productively with data teams and avoid the loss of irreplaceable records.

Remember

What the exams ask

How it is used, across a career

As a student

A student uses this subject in every quantitative course: computing means, CVs and quadratic mean diameter from tally sheets, standard errors and confidence intervals for plot data, the number of plots needed for a target precision, t and chi-square tests on nursery and seed data, regression lines for height and volume, and ANOVA tables for field trials. Typical mistakes are dividing by n instead of n − 1, using 1.96 for small samples, forgetting the log back-transformation correction, and confusing confidence with prediction intervals.

Five years in

A forester five years into practice plans inventories with target precision and cost, checks cruise data for errors, builds or selects volume and biomass equations, summarises stand tables in spreadsheets or scripts, analyses operational trials of fertiliser or planting stock, and explains to managers what a sampling error of plus or minus 8 percent means. Increasingly the same forester writes short R or Python scripts so that annual reports can be rerun reliably.

Twenty-five years in

A senior forester with twenty-five years of experience sets standards for inventories and data systems across an organisation: precision targets for harvest planning and carbon reporting, check-cruise rules, equation libraries, database design and data governance. Judgements include when an old equation is no longer valid for new genotypes or sites, how much inventory precision is worth paying for, and how to defend estimates to auditors and buyers.

PhD, twenty-five years in

A researcher with a PhD and long experience develops and teaches biometric methods: model-based and design-based inference, mixed and non-linear models for growth and allometry, uncertainty propagation in biomass and carbon estimates, and reproducible computing. Such researchers review the statistics in theses and journal papers, set examination questions and advise national inventory programmes, so they must be fluent in both theory and practical software.

Written from

This manual teaches the core methods with hand calculations; it does not cover sampling designs beyond simple random and stratified sampling in outline, design-based versus model-based inference, mixed and Bayesian models in depth, multivariate statistics, spatial statistics or machine learning, which appear in the inventory, research methods and GIS subjects or in the Agricultural Statistics track. Software examples name common functions only; versions and packages change. Critical values quoted are for illustration; use tables or software for exact values.

Original practice questions written to the syllabus and pattern of the exams named in each question's examTags. They are not past papers and do not reproduce any board's questions.

Practise it, and prove it

These notes are free to read here, with no account.

What the Laisha app adds:

Free for ten days, then a subscription. We would rather write that here than have you find it later.

Open Laisha →