Local macros help create more general functions than Global macros or Execs. Rather than running from column references in the worksheet, we send data to a Local macro. This is run internally. On running a Local macro, we identify the data to be sent into the macro. We also need to declare the data type of variables used within the macro.
Here, we will convert the GSession macro from the previous recipe into a Local macro. This will allow us to tell the macro to use a column instead of looking for a specific column name or reference.
At this step, we will also simplify the function by removing the commands for the one sample t-test and one variance test.
Open the Macro data.MTW
worksheet by using an open worksheet in the file menu. Then open the Gsession.mac
file, which was created in Notepad in the previous recipe. Or, open the provided catch-up file.