﻿* Encoding: UTF-8.
* Sample OUTPUT CREATE command.
* Open sample file "Employee Data.sav" before running for best results.
OUTPUT CREATE
    /SPEC SOURCE=INLINE.
BEGIN STATJSON
{
  "procedure": {
    "items": [
      {
        "table": {
          "caption": {
            "footnote_refs": [
              1
            ], 
            "value": "This table is the first table created"
          }, 
          "cells": [
            [
              1, 
              0.5, 
              1, 
              {
                "subscripts": "a,c,e", 
                "value": 3.0
              }, 
              0.857
            ], 
            [
              1.1, 
              1.5, 
              1, 
              3, 
              0.854
            ], 
            [
              1.2, 
              0.5, 
              1, 
              3, 
              0.852
            ], 
            [
              0.9, 
              0.5, 
              1, 
              3, 
              0.848
            ], 
            [
              0.8, 
              0.5, 
              1, 
              3, 
              0.844
            ], 
            [
              1, 
              0.5, 
              null, 
              null, 
              0.835
            ], 
            [
              0.9, 
              0.5, 
              null, 
              null, 
              0.833
            ], 
            [
              1.1, 
              0.5, 
              null, 
              null, 
              0.831
            ], 
            [
              0.7, 
              0.5, 
              1, 
              3, 
              0.829
            ]
          ], 
          "corner": {
            "value": "Sample corner text"
          }, 
          "default_cell_format": {
            "decimals": 3, 
            "type": "F"
          }, 
          "dimensions": {
            "columns": [
              {
                "descendants": [
                  "Alpha", 
                  "Gamma", 
                  "Coef0", 
                  {
                    "default_cell_format": {
                      "decimals": 0
                    }, 
                    "value": "Degree"
                  }, 
                  "Mean Test Subset R Square"
                ], 
                "show_dimension_categories": true, 
                "show_label": false, 
                "value": "Statistics"
              }
            ], 
            "rows": [
              {
                "descendants": [
                  "Polynomial", 
                  "Polynomial", 
                  "Polynomial", 
                  "Polynomial", 
                  "Polynomial", 
                  {
                    "descendants": [
                      "RBF", 
                      "RBF", 
                      "RBF"
                    ], 
                    "value": "RBF Group"
                  }, 
                  "Polynomial"
                ], 
                "value": "Kernal"
              }
            ]
          }, 
          "footnotes": [
            "Dependent Variable: y", 
            "Model: x1, x2", 
            "Number of crossvalidation folds: 5"
          ], 
          "hide_title": false, 
          "max_data_column_width": 300, 
          "min_data_column_width": 200, 
          "name": "Model Comparisons", 
          "title": {
            "footnote_refs": [
              0, 
              1, 
              2
            ], 
            "value": 2, 
            "variable": "jobcat"
          }
        }
      }
    ],
    "name": "Simple table example"
  }
}
END STATJSON.

OUTPUT CREATE
    /SPEC SOURCE=INLINE.
BEGIN STATJSON
{
  "procedure": {
    "items": [
      {
        "text": {
          "content": "Some text content", 
          "name": "A Text Title for the Nav Pane"
        }
      }, 
      {
        "warning": {
          "text": "This is an example of a warning message."
        }
      }, 
      {
        "notes": [
          {
            "cell_value": "This is an example of a python error message.", 
            "row_header": "Python Errors"
          }
        ]
      }
    ], 
    "name": "Text, warning, notes examples"
  }
}
END STATJSON.

OUTPUT CREATE
    /SPEC SOURCE=INLINE.
BEGIN STATJSON
{
  "procedure": {
    "items": [
      {
        "graph": {
          "X": {
            "data": [
              0, 
              1, 
              2, 
              3, 
              4, 
              5, 
              6, 
              7, 
              8, 
              9, 
              10, 
              11, 
              12, 
              13, 
              14, 
              15
            ], 
            "label": "y"
          }, 
          "Y": {
            "data": [
              0, 
              1, 
              4, 
              9, 
              16, 
              25, 
              49, 
              64, 
              81, 
              100, 
              121, 
              144, 
              169, 
              196, 
              225
            ], 
            "label": "Predicted Value"
          }, 
          "name": "Scatterplot of y by Predicted Value",
          "templates": [
            "<setStyle subtype='simple' type='scatter'><style color2='transparent' size='20pt'/></setStyle>"
          ], 
          "title": "Scatterplot of y by Predicted Value", 
          "type": "Scatterplot"
        }
      }, 
      {
        "graph": {
          "X": {
            "data": [
              1, 
              2, 
              3, 
              4
            ], 
            "label": "Some Values"
          }, 
          "Y": {
            "data": [
              100, 
              200, 
              50, 
              400
            ], 
            "label": "Other Values"
          }, 
          "name": "Area Test", 
          "templates": [
            "/Applications/IBM SPSS Statistics/Resources/Looks/Mellow.sgt"
          ], 
          "title": "Area of values", 
          "type": "Area"
        }
      }, 
      {
        "graph": {
          "X": {
            "data": [
              "male", 
              "female", 
              "male", 
              "female"
            ], 
            "label": "Gender"
          }, 
          "Y": {
            "data": [
              100, 
              200, 
              150, 
              250
            ], 
            "label": "Count"
          }, 
          "name": "Counts by Gender", 
          "position_modifier": "stack", 
          "split": {
            "data": [
              "red", 
              "red", 
              "red", 
              "green"
            ], 
            "label": "Color"
          }, 
          "title": "Counts by Gender", 
          "type": "Bar"
        }
      }, 
      {
        "graph": {
          "X": {
            "data": [
              1, 
              2, 
              3, 
              4, 
              5
            ], 
            "label": "Some Values"
          }, 
          "Y": {
            "data": [
              100, 
              200, 
              50, 
              400, 
              500
            ], 
            "label": "Other Values"
          }, 
          "name": "Line Test", 
          "title": "Line of values", 
          "type": "Line"
        }
      }, 
      {
        "graph": {
          "X": {
            "data": [
              "male", 
              "female"
            ]
          }, 
          "Y": {
            "data": [
              100, 
              200
            ]
          }, 
          "name": "Pie Test", 
          "title": "Pie of values", 
          "type": "Pie"
        }
      }, 
      {
        "graph": {
          "X": {
            "data": [
              1, 
              1, 
              1, 
              1, 
              1, 
              1, 
              1, 
              1, 
              2, 
              2, 
              2, 
              3, 
              3, 
              3, 
              4, 
              4, 
              4, 
              4, 
              4, 
              4, 
              4, 
              4, 
              4
            ], 
            "label": "Salary"
          }, 
          "name": "Histogram Test", 
          "title": "Histogram", 
          "type": "Histogram"
        }
      }, 
      {
        "graph": {
          "X": {
            "data": [
              "male", 
              "female", 
              "female", 
              "female", 
              "female", 
              "male", 
              "male", 
              "female", 
              "male", 
              "male"
            ], 
            "label": "Gender"
          }, 
          "Y": {
            "data": [
              100, 
              200, 
              150, 
              20, 
              220, 
              111, 
              156, 
              76, 
              120, 
              210
            ], 
            "label": "Count"
          }, 
          "name": "Boxplot Test", 
          "title": "Boxplot", 
          "type": "Boxplot"
        }
      }
    ], 
    "name": "Simple graph examples"
  }
}
END STATJSON.
      
OUTPUT CREATE
    /SPEC SOURCE=INLINE.
BEGIN STATJSON
{
  "procedure": {
    "items": [
      {
        "gpl_graph": {
          "data": [
            {
              "source_name": "graphdataset", 
              "variable_data": {
                "data": [
                  0, 
                  1, 
                  2, 
                  3, 
                  4, 
                  5, 
                  6, 
                  7, 
                  8, 
                  9, 
                  10, 
                  11, 
                  12, 
                  13, 
                  14, 
                  15
                ]
              }, 
              "variable_name": "dotSource"
            }
          ], 
          "editable": false, 
          "gpl": [
            "SOURCE: s=userSource(id(\"graphdataset\"))", 
            "DATA: dotSource=col(source(s), name(\"dotSource\"))", 
            "COORD: rect(dim(1))", 
            "GUIDE: axis(dim(1), label(\"test data\"))", 
            "GUIDE: text.title(label(\"Simple Dot Plot of test data\"))", 
            "ELEMENT: point.dodge.asymmetric(position(bin.dot(dotSource)))"
          ], 
          "name": "Test of GPL generated chart"
        }
      }
    ], 
    "name": "Graphics Programing Language example"
  }
}
END STATJSON.

OUTPUT CREATE
    /SPEC SOURCE=INLINE.
BEGIN STATJSON
{
  "procedure": {
    "items": [
      {
        "heading": {
          "items": [
            {
              "image": {
                "image_path": "/Applications/IBM SPSS Statistics/Resources/R/lib/R/doc/manual/images/QQ.png", 
                "name": "Test Image", 
                "type": "png"
              }
            }
          ], 
          "label": "My Heading"
        }
      }
    ], 
    "name": "Nested heading and image example"
  }
}
END STATJSON.
