---
title: "Plot counts by category"
url: "https://openforis.support/questions/3196/plot-counts-by-category"
tags: ["calc"]
status: "answered"
score: 0
answer_count: 4
asked: "2021-08-03T16:22:44"
last_activity: "2021-08-04T12:19:10"
source: "Open Foris Support - Q&A Forum"
license: "Copyright Open Foris, 2021. Some rights reserved under creative commons license."
---

# Plot counts by category

Asked by jpdash on 2021-08-03

Hi,

My inventory has a nested sub-plot design with sub-plots of various sizes where different sized trees are measured. I have specified the plot as the base unit of aggregation in the sampling design. Several variables (e.g. primary disturbance type and topographic information) are recorded at the plot level. I would like to be able to show plot counts by various categories in Saiku. I thought I would be able to make a plot count variable in the plot entity using 

    plot$plot_count<-1 

When I try to make this variable I am not allowed and get the error message 
 
*"You can not add a quantitative variable to the sampling unit entity."*

I presume that this is because plot is the base unit of aggregation in my inventory. Can you please suggest a workflow to allow me to show plot counts for categorical variables in Saiku?

Many thanks,

Jonathan


## Answer (score 0, by Lauri (OF) on 2021-08-04)

Link: https://openforis.support/questions/3196/plot-counts-by-category/3200

Dear Jonathan,

Calc cannot show quantitative variables for the base unit level. Please see discussion and solution with R script: plot (or base unit) results are written into a CSV file: [https://www.openforis.support/questions/778/new-rscript-variable-in-calc-21-a3-on-plot-level?page=1&focusedAnswerId=803#803][1]

Just a question: could your base unit be a subplot? In that case, in the sampling design you should select "Cluster" sampling where your cluster is 'plot', and <b>not select</b> "Apply cluster sampling only for variances". And then you could get the number of plots via Saiku too.

regard, Lauri


  [1]: https://www.openforis.support/questions/778/new-rscript-variable-in-calc-21-a3-on-plot-level?page=1&focusedAnswerId=803#803


## Answer (score 0, by jpdash on 2021-08-04)

Link: https://openforis.support/questions/3196/plot-counts-by-category/3202

Dear Lauri,

Thanks for this response and the clarification regarding extracting plot-level data to CSV using R.

It is not totally clear to me whether the base unit should be the plot or a sub-plot. My inventory uses cluster sampling with clusters located on a systematic grid. Each cluster contains five plots and the plots are far enough apart to be considered independent sampling units. When defining the sampling design in Calc I selected plot as the base unit, selected "Cluster" sampling, and selected "Apply cluster sampling only for variances". As I mentioned previously each plot contains nested sub-plots of various dimensions each measuring different sized trees and stored within a different entity in the database schema (sub-plot A, B, C, and seedlings). I like the idea of specifying a sub-plot as the base unit so that I can display plot data via Saiku. However, the question then becomes which sub-plot should I select as the base unit and whether the estimator will provide valid results when configured in this manner.

I greatly appreciate your expert advice on this matter.

Many thanks,

Jonathan


## Answer (score 0, by Lauri (OF) on 2021-08-04)

Link: https://openforis.support/questions/3196/plot-counts-by-category/3203

Dear Jonathan,

thank you for clarification. I think that in your case you have done all right because sub-plots are split into different entities. In that case you cannot select one particular sub-plot as a base unit. If you would have just one sub-plot table in Collect, then you could do it, and forget the clusters because plot are independent sampling units.

About getting reliability estimates: if plots are considered independent sampling units, the (relatively easy) method is to write the plots level result variables (volume/biomass/carbon?) into a CSV file (as shown in the linked answer), and compute the variances etc. simply in Excel or R. 

regards, Lauri


## Answer (score 0, by jpdash on 2021-08-04)

Link: https://openforis.support/questions/3196/plot-counts-by-category/3204

Dear Lauri,

Thank you for this clarification. I will export the plot-level summaries and compute the variance in R.

Thanks,

Jonathan
