You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

This example shows template programming code specified for an analysis method defined in the method attribute of the reporting event (lines 14-41). In this example, there are 3 parameters associated with the template programming code, each containing a reference to a metadata element in the valueSource attribute. The metadata references are defined relative to the analysis using the method in the format orderedGroupings[x].groupingId.groupingVariable  which indicates (according to the sponsor's applied syntax) "the value of the groupingVariable attribute of the instance of the (subject or data) grouping factor referenced in the groupingId attribute of the list of orderedGroupings for the analysis where order = x". The template programming statements (for which the computer language is "SAS Version 9.4", as specified in the context attribute) contain replacement parameter references corresponding with the 3 template code parameters. The parameter references are formatted to facilitate the sponsor's Python-based implementation, which involved copying the template programming code to the analysis while replacing the replacement parameter references with the values obtained from the metadata references to create analysis-specific programming statements that are ready for execution. 

The example also shows, in the analyses attribute of the reporting event, the definition of an analysis that uses the defined method and contains the resultant programming statements in its programmingCode attribute (lines 42-63). The sponsor chose not to record the analysis-specific parameter values with the analysis because they are already represented in the analysis-specific programming code.

Partial definitions of the referenced subject grouping factors are also shown in the reporting event's analysisGroupings attribute (lines 1-13) to show the metadata values that were obtained via the metadata references. The details of the groups within the grouping factors have been omitted for brevity.

YAML Example
analysisGroupings:
- id: AnlsGrouping_01_Trt
  dataDriven: false
  label: Treatment
  groupingVariable: TRT01A
  groups:
  ...
- id: AnlsGrouping_03_AgeGp
  dataDriven: false
  label: Age Group
  groupingVariable: AGEGR1
  groups:
  ...
methods:
- id: Mth03_CatVar_Comp_PChiSq
  name: Pearson's chi-square test group comparison for a categorical variable
  label: Pearson's chi-square test
  description: Comparison of groups by Pearson's chi-square test for a categorical
    variable. Maximum of two grouping variables.
  operations:
  - id: Mth03_CatVar_Comp_PChiSq_1_pval
    name: P-value
    label: p-value
    resultPattern: X.XXXX
  codeTemplate:
    context: SAS Version 9.4
    code: "proc freq data={dataset};
      table {grp1var}*{grp2var}/chisq;
      exact pchi;
      ods output PearsonChiSq=PCHI{grp2var};
      run;"
    parameters:
    - name: dataset
      description: Input dataset
      valueSource: dataset
    - name: grp1var
      description: First grouping variable
      valueSource: orderedGroupings[1].groupingId.groupingVariable
    - name: grp2var
      description: Second grouping variable
      valueSource: orderedGroupings[2].groupingId.groupingVariable
analyses:
- name: Comparison of Age Group by Treatment
  id: An03_02_AgeGrp_Comp_ByTrt
  methodId: Mth03_CatVar_Comp_PChiSq
  version: 1
  dataset: ADSL
  variable: USUBJID
  analysisSetId: AnalysisSet_02_SAF
  orderedGroupings:
  - order: 1
    resultsByGroup: false
    groupingId: AnlsGrouping_01_Trt
  - order: 2
    resultsByGroup: false
    groupingId: AnlsGrouping_03_AgeGp
  programmingCode:
    context: SAS Version 9.4
    code: "proc freq data=ADSL;
      table TRT01A*AGEGR1/chisq;
      exact pchi;
      ods output PearsonChiSq=PCHIAGEGR1;
      run;"
  • No labels