The sampling design section has as question/answer user interface. Choices are made by clicking the appropriate button which, by turning green, indicates that a selection has been made.
The following steps will guide you to define the sampling design in Calc.
Click on Sampling Design and then on the Edit button.
1. Select the entity that represents the sampling unit (table 1). For the test example select plot.
Click on the right-arrow to proceed to the next step.
2. Select whether the sampling design is Simple random (SRS) or Systematic.
The next step requires the selection of the sampling design of the survey. For the test example select Systematic.
Note: in CALC a selection is confirmed when the button turns green.
Proceed with Settings by clicking on the right arrow.
3. Select whether the survey is designed with double sampling (2 phases). For the test example select 2-phases.
The system will require the user to upload a csv file containing the first phase points that will be converted into a database table (table 2). (column names are user defined)
The user must define the columns that will be used to join with the sampling unit table. This is necessary to link the first phase points with their observations. (e.g. see yellow arrows in the 'Data tables and relational joins' section).
Calc recognizes the file structure and before importing the file the user should select which columns to import and define the data type of each column, choosing from Integer, real or String. Integer and real refer to numerical values (with or without decimals), String refers to a coded value (please note that even if a value is indicated with a number it may actually refer to a code). In our example, make the selection as shown in the image below.
Then click on Import.
A running import window will appear showing that the csv has been successfully imported (100%). In case of errors or notifications they will be displayed in the Log window.
4. Next steps requires to define the joins between tables. The rationale for this process is that each table should have at least one column in common with another table, and that column will be the join (see the join between table1 and table 2 in the Data tables and relational joins section). In our example, under phase 1 table select cluster and make the join with plot_view table by selecting cluster_id. Additional joins can be added by clicking on the small [+] sign to the right. In our example proceed by selecting plot and making the join it with plot_no.
5. Click on the right-arrow to proceed to the next step in which the user is asked to indicate whether the survey has any stratification.
If the survey is stratified (like in the test example), click the Stratified button. The button will turn green and you will be asked to upload a csv file containing the stratification table
In the test example, the survey contains three strata as visible in the uploaded file calc-strata.csv
The system will require to upload a csv file containing the strata definition that will be converted into a table (table 3) (column 'a' defines the stratum number, and column 'b' the stratum caption).
The user must define the column that will be used to identify the stratum for each record [in case of double sampling the column has to be present in the phase-1 table (table 2) , otherwise in the sampling unit table (table 1)].
Select stratum as the column that serves as a join (see the join between table 2 and table 3 in the Data tables and relational joins section). Then click right-arrow for the next step
6. If the survey has a cluster design, select Cluster.
The user must define the column that represents the cluster code [in case of double sampling the column has to be present in the phase-1 table (table 2), otherwise in the sampling unit table (table 1)].
For the test example select cluster. (see cluster column in the Data tables and relational joins section)
7. Define the area of interest. The system requires the users to indicate the column that represents the lowest level of the administrative unit hierarchy previously imported (table 4). [In case of double sampling the column has to be present in the phase 1 table (table 2) , otherwise in the sampling unit table (table 1)].
For the test example select aoi_code. (see the join between table 2 and table 4 in the Data tables and relational joins section)
Then move to the next step
8. The last step requires the user to write an R script to calculate the weight of each record of the sampling unit table. The script will assign a weight to each record (sampling unit) by adding a column (named weight) to the sampling unit table (table 1).
For the test example the following R script will be entered:
plot$weight = ifelse ( is.na ( plot$subplot ) | plot$subplot == 'A' , 1 , 0 )
You will see a window confirming that the sampling unit weight has been recorded and used to calculate the expansion factor.
Click close and you will be prompted with a window showing all the selected Settings. If you wish to make any modification in the sampling design settings click Edit.
Otherwise click the left-arrow at the bottom of the screen to return to the Settings panel.
Next step is to define the Aggregation function which represents the formula of the plot area for the entities you wish to aggregate following the sampling design. ( e.g. trees / dead wood etc..)
Click on Aggregation to select the Entity. For the test example select Tree.
You will then be prompted to enter a Plot area script. The following example shows how to calculate the plot area for 3 circular nested plots with radius of 1, 5 and 10 mt. respectively.
tree$plot_radius <- with(tree,
tree$plot_area <- with(tree, pi * plot_radius^2 * share / 100);
#convert plot area factor from m2 to ha
tree$plot_area <- tree$plot_area * 0.0001;
Enter the script as indicated. Then click Save. You will see appearing a green confirmation message (in the top part of the screen). Then click left-arrow to go back to main Settings page.