set form {
  GuidoForm form_1 {
    -default_buttons
    -label "Basic statistics"
    GuidoPanel panel_1 {
    -layout BoxLayout Y_AXIS
      GuidoTextArea gainfocus {
      -visible true
      -default "This text area is here to remove focus and highlighting from the second GuidoTextArea
                This text area must have visible set to true in order to gain focus"
      -height 0
      -width 0
      }
      GuidoLabel space {
      -height 0.5
      }
      GuidoScrollPane scroll_1 {
      -height 14
      -width 75
        GuidoTextArea text_1 {
        -wrap_style_word true
        -linewrap true
        -input true
        -font_highlight 0 0 0
        -default "
Basic statistics should be performed before variogram modelling for a couple of reasons:

1. The shape of the histogram can be used to determine if a distribution is bimodal (has two humps).
If the histogram shows a bimodal distribution, the data should be analysed graphically to see if it can be physically segregated into two separate zones.  If so, each zone should be modelled separately.

2. The quality of experimental variograms and subsequent block model estimations are sensitive to outliers (relatively large values).

Outlier values should be cut or removed prior to variogram modelling or block model estimation.  The value used to cut or remove outliers can be calculated from information in the basic statistics report."
        }
      }
      GuidoLabel space {
      -height 0.5
      }
    }
  }
}

SclCreateGuidoForm form_handle $form {
}

$form_handle SclRun {
}

set status [ SclFunction "EXIT GRAPHICS" {} ]

set status [ SclFunction "GEOLOGY DATABASE DISCONNECT" {} ]

set status [ SclFunction "BASIC STATISTICS" {} ]

set status [ SclFunction "STATS RELOAD" {
  frm20400={
    {
      _action=display
      location="gold_comp"
      id="2"
      str="1,2"
      dfields={
        {
          dfield="D1"
          label="Gold"
          min=""
          max=""
        }
      }
      min0=""
      min1=""
      min2=""
      max0=""
      max1=""
      max2=""
      binNum_or_Width="WIDTH"
      bin_width="1"
      negative="NEGATIVES"
    }
  }
}]

set status [ SclFunction "STATS STATISTICS" {
  frm20431={
    {
      _action=display
      range="25,75,25;90;95;99"
      fname="raw_gold"
      report_format=".not - Surpac Note File"
      file_append_overwrite="OVERWRITE"
    }
  }
}]

set status [ SclFunction "STATS HISTOGRAM" {} ]

set form {
  GuidoForm form_2 {
    -default_buttons
    -label "Basic statistics"
    GuidoPanel panel_2 {
    -layout BoxLayout Y_AXIS
      GuidoTextArea gainfocus {
      -visible true
      -default "This text area is here to remove focus and highlighting from the second GuidoTextArea
                This text area must have visible set to true in order to gain focus"
      -height 0
      -width 0
      }
      GuidoLabel space {
      -height 0.5
      }
      GuidoScrollPane scroll_2 {
      -height 8
      -width 40
        GuidoTextArea text_2 {
        -wrap_style_word true
        -linewrap true
        -input true
        -font_highlight 0 0 0
        -default "
As you can see from the histogram, this distribution is not bimodal.

The basic statistics report will be displayed next.

Note the values of the mean, standard deviation, and percentiles."
        }
      }
      GuidoLabel space {
      -height 0.5
      }
    }
  }
}

SclCreateGuidoForm form_handle $form {
}

$form_handle SclRun {
}

set status [ SclFunction "STATS EXIT" {} ]

set status [ SclFunction "RECALL ANY FILE" {
  file="raw_gold.not"
  mode="openInNewLayer"
}]

puts  ""
puts  ""
puts  "Macro 08a_basic_statistics.tcl completed."
puts  ""