Scripts - PROC command
PROC command: Statistical procedures and graphs
With the PROC command, you can calculate the statistical reports and draw the graphs in the MedCalc Statistics and Graphs menus.
To obtain a report or graph, you proceed as follows:
- the required system variables (parameters) are set; for a complete list of parameters for each procedure, see Parameters for statistical procedures and graphs.
- the procedure is invoked with the PROC(procname[,tablename) command
When you do use the 2nd parameter tablename, then the statistical procedure will create an additional summary table containing the most important results of the statistical procedure.
Reports and graphs
When you execute a statistical procedure in a MedCalc script using the PROC command, as described above, then MedCalc will store the report and possible graphs in system variables $report, $graph, $graph1, and $graph2.
To display the report and graphs in the script output frame, use the print command:
$decimalsymbol=".";
$listseparator=",";
<data>
BMI
22.1 20.1 24.8 27 26 22.5 24.9 21.6 26.2 20.2 24.1 27.5 25.2 24.9 21.6 23.3 22.2
</data>
$Variable="BMI";
$Output=off; // prevent output (display of reports)
PROC(MEANS);
$Output=on; // reset output
?$report;
You can also write the report and graph to a file:
$decimalsymbol="."; $listseparator=","; <data> BMI 22.1 20.1 24.8 27 26 22.5 24.9 21.6 26.2 20.2 24.1 27.5 25.2 24.9 21.6 23.3 22.2 </data> $Output=off; // prevent output filename=@desktoppath+"report.doc"; CreateHTML(filename); $Variable="BMI"; PROC(MEANS); Write(filename,$report); PROC(BOXWHISKER); Write(filename,$graph); CloseFile(filename); ViewFile(filename);