Help Manual

Contents






Sigma Magic Help Version 15

Regression

Overview

Regression analysis can be used to develop a model between an output Y and one or more input Xs. If only one input is specified, the model developed can be linear, quadratic, or cubic. If more than one X is specified, then only a linear model is developed. The model coefficients can be either full (complete model) or Auto (automatic model reduction to a statistically significant model). The following figure shows a flowchart for the various models that can be currently fit using this software. regression flowchart This tool can be added to your active workbook by clicking on Stats and then selecting Regression Analysis.

Inputs

Click on Analysis Setup to open the menu options for this tool.

Setup

A sample screenshot of the setup menu is shown below.
Regression Input Dialog Box
1
Data Type: Specify the type of data you have for your dependend variable (Y). The available options are:
OptionDescription
BinaryA Binary data has two possible values (0/1).
ContinuousContinuous data can take any arbitrary value (like the temperature of the room example 34.53 deg centigrade).
2
Num Variables: Specify the number of input variables. If the number of input variables is 1, then the software will fit a simple regression model. If the number of input variables is greater than 1, then the software will fit a multiple regression model.
3
Regression Model: Specify the type of regression model you want to build. The available options if the number of input variables is 1 are:
OptionDescription
LinearBuild a linear regression model Y = mX + c.
QuadraticBuild a quadratic regression model Y = aX^2 + bX + c.
CubicBuild a cubic regression model Y = aX^3 + bX^2 + cX + d.
ManualSpecify the terms you want to include in the model by specifying the model terms.
If there are more than 1 independent variable, then only the linear model option is available.
4
Show Predictions: Specify if you want to use the model you have developed to make predictions. The following options are available:
OptionDescription
NoDo not make any predictions.
YesMake predictions for the specified input data set. Note that if the response variable is blank in the input data set, that row of data is not used to build the model, however, those rows of data will be used for predictions. An output prediction column is displayed on the worksheet with predicted output values.
5
Flowchart: Click on this button to open the flowchart for both correlation & regression.
6
Help Button: Click on this button to open the help file for this topic.
7
Cancel Button: Click on this button to cancel all changes to the settings and exit this dialog box.
8
OK Button: Click on this button to save all changes and compute the outputs for this analysis.

Data

If you click on the Data button, you will see the following dialog box. Here you can specify the data required for this analysis. Data
1
Search Data: The available data displays all the columns of data that are available for analysis. You can use the search bar to filter this list and to speed up finding the right data to use for analysis. Enter a few characters in the search field and the software will filter and display the filtered data in the Available Data box.
2
Available Data: The available data box contains the list of data available for analysis. If your workbook does not have any data in tabular format, this box will display "No Data Found". The information displayed in this box includes the row number, whether the data is Numeric (N) or Text (T), and the name of the column variable. Note that the software displays data from all the tables in the current workbook. Even though data within the same table have unique column names, columns across different tables can have similar names. Hence, it is important that you not only specify the column name but also the table name.
3
Add or View Data: Click on this button either to add more data into your workbook for analysis or to view more details about the data listed in the available data box. When you click on this button, it opens up the Data Editor dialog box where you can import more data into your workbook, or you can switch from the list view to a table view to see the individual data values for each column.
4
Required Data: The code for the required data specifies what data can be specified for that box. An example code is N: 2-4. If the code starts with an N, then you will need to select only numeric columns. If the code starts with a T, then you can select both numeric and text columns. The numbers to the right of the colon specify the min-max values. For example, if the min-max values are 2-4, then you need to select a minimum of 2 columns of data and a maximum of 4 columns of data in this box. If the minimum value is 0, then no data is required to be specified for this box.
5
Select Button: Click on this button to select the data for analysis. Any data you select for the analysis is moved to the right. To select a column, click on the columns in the Available Databox to highlight them and then click on the Select Button. A second method to select the data is to double click on the columns in the list of Available Data. Finally, you can also drag and drop the columns you are interested in by holding down the select columns using your left mouse key and dragging and dropping them in one of the boxes on the right.
6
Selected Data: If the right amount of data columns has been specified, the list box header will be displayed in the black color. If sufficient data has not been specified, then the list box header will be displayed in the red color. Note that you can double-click on any of the columns in this box to remove them from the box.

The data you specify for this analysis depends on the options you have specified in the Setup tab. Specify the column containing the output or dependent variable under Response Variable and the columns containing the inputs or independent variables under Factor Variables. Note that you can only specify one column under the response variable and N columns for the factor variables where N is the number of input variables specified in the Setup dialog box. Make sure that all the columns contain numeric values.

If you have any categorical factors, they need to be specified in the listbox for categorical factors. Note that these factors can be in text format. You need to have at least one variable that is continuous. The categorical factors are internally converted to continuous factors using dummy variables. For example, if a categorical factor name is Shift and it has three levels 1st Shift, 2nd Shift, and 3rd Shift. The first shift is denoted as Shift.1 and the second shift is denoted as Shift.2 and the third shift as Shift.3. You can use these variables in model terms if you want to build a regression model manually.
7
View Selection: Click on this button to view the data you have specified for this analysis. The data can be viewed either in a tablular format or in a graphical summary.

Options

If you click on the Options button, you will see the following dialog box. Charts
1
Model Reduction: Specify if you want automatic model reduction when you build the model. If you pick the Auto option, the software will first build the full model and then drop terms that are not significant to get to the reduced order model that is statistically significant. If no model is significant, then the final reduced order model will be Y = constant.
2
Method: Specify the method to use for regression analysis. Currently, the only method available is Least Squares fit.
3
Confidence Level: Specify the confidence level for this analysis. This value is used to determine the prediction and/or confidence intervals. The default value for confidence level is 95%.
4
Model Reduction Alpha: Specify the model reduction alpha value. This value will be used to reduce your regression model. The software starts with the full model and drops those terms that are non-significant until a fully significant model remains. The default value for model reduction alpha is 10%.
5
Model Terms: If you specify the regression model as manual, you will need to specify the model terms that you want to use to build the regression model. The model terms should be expressed in terms of the variables you have specified in your input variable data set. Each term in the model should be specified separated by a plus (+) sign.

For example, if your input variables are Weight and Length, then the model terms could be Weight + Length + Weight*Length + Weight^2. The constant term will automatically be added to any model you specify so you do not need to specify the constant value. This will build a regression model that has 4 terms and the regression model will consider these terms in its model. Make sure that when you specify the manual regression terms your matrix is not singular. For example, if you specify a term that does not exist in your input data set, all values in that input column for that variable will contain 0 values and your matrix will be singular and hence you will not be able to build that model.

It is the responsibility of the user to specify the model terms correctly. If you use Auto reduction on the model terms, it will drop the non-significant terms from the right to the left, so make sure that you specify the correct order for the model terms.
6a
Confidence Interval: Specify if you want to superimpose the confidence interval or the prediction interval on the regression plot. These intervals are plotted based on the confidence level you have specified in your analysis.
6b
Residual Plots: Specify the type of residual plots you want to plot for this analysis. These plots can be used to determine if our model assumptions are met for using the regression modeling. Basically, the residuals should be normally distributed, have zero mean, and be randomly distributed for both the fitted values and run order. These can be visually checked by viewing the residual plots.

Charts

If you click on the Charts button, you will see the following dialog box. Charts
0
Pick Charts: Select the charts you would like to display for this analysis.
1
Title: The system will automatically pick a title for your chart. However, if you would like to override that with your own title you can specify a title for your chart here. Note that this input is optional.
2
Sub Title: The system will automatically pick a subtitle for your chart. However, if you would like to override that with your own subtitle you can specify a subtitle for your chart here. Note that this input is optional.
3
X Label: The system will automatically pick a label for the x-axis. However, if you would like to override that with your own label for the x-axis you can specify a different label here. Note that this input is optional.
4
Y Label: The system will automatically pick a label for the y-axis. However, if you would like to override that with your own label for the y-axis you can specify a different label here. Note that this input is optional.
5
X Axis: The system will automatically pick a scale for the x-axis. However, if you would like to override that with your values for the x-axis, you can specify them here. The format for this input is to specify the minimum, increment, and maximum values separated by a semi-colon. For example, if you specify 10;20 then the minimum x-axis scale is set at 10 and the maximum x-axis scale is set at 20. If you specify 10;2;20, then, in addition to minimum and maximum values, the x-axis increment is set at 2. Note that this input is optional.
6
Y Axis: The system will automatically pick a scale for the y-axis. However, if you would like to override that with your values for the y-axis, you can specify them here. The format for this input is to specify the minimum, increment, and maximum values separated by a semi-colon. For example, if you specify 10;20 then the minimum y-axis scale is set at 10 and the maximum y-axis scale is set at 20. If you specify 10;2;20, then, in addition to minimum and maximum values, the y-axis increment is set at 2. Note that this input is optional.
7
Horizontal Lines: If you want to add a few extra horizontal reference lines on top of your chart you can specify the values here. The format for this input is numeric values separated by semi-colon. For example, if you specify 12;15 then two horizontal lines are plotted at Y = 12 and Y = 15 respectively. Note that this input is optional.
8
Vertical Lines: If you want to add a few extra vertical reference lines on top of your chart you can specify the values here. The format for this input is numeric values separated by semi-colon. For example, if you specify 2;5 then two vertical lines are plotted at X = 2 and X = 5 respectively. Note that this input is optional.

Verify

If you click on the Verify button, the software will perform some checks on the data you have entered. A sample screenshot of the dialog box is shown in the figure below. Verify The objective of this analysis as well as any checks that are performed is listed in this dialog box. For example, the software may check if you have correctly specified the input options and entered the required data on the worksheet. The results of the analysis checks are listed on the right. If the checks are passed, then they are shown as a green-colored checkmark. If the verification checks fail, then they are shown as a red-colored cross. If the verification checks result in a warning, they are shown in the orange color exclamation mark and finally, any checks that are required to be performed by the user are shown as blue info icons.

Outputs

Click on Compute Outputs to update the output calculations. A sample screenshot of the worksheet with simple regression is shown below. outputs The analysis results are shown in the notes section. This includes the correlation coefficient between the output and input(s), the R^2 value of the fit, the ANOVA model between X and Y, and the model equation between the output and input(s). The graph includes a fitted line plot with the raw data points shown in blue and the model fit shown in red.

A histogram of the residuals along with the residuals for the run order and the fit values is also displayed. Make sure that the residuals are randomly distributed and there is no pattern of the residuals concerning the run order or the fit value. If there are any problems with the residuals, you may need to revisit your regression model. outputs If we were performing multiple regression, an analysis such as the one shown below will be displayed. outputs 2 If we want to perform a general regression, you will have to manually recreate the inputs and then build the regression model. In the following example, a squared term and an interaction term are included in the model. outputs 3 If we performed a quadratic regression, we may get an output similar to the one shown in the figure below. outputs 4 If we perform a binary logistic regression, you may get an output similar to the one shown in the figure below. outputs 5

Notes

Here are a few pointers regarding this analysis:
  • You can fit up to 30 factors with this worksheet.
  • Auto feature uses a stepwise-backward regression. The Auto functionality first fits a model with all the terms included. It then drops the terms that have a P-value greater than the alpha value and re-fits the model. It continues this process until only significant terms are left in the model.

Examples

Following examples can be found in the Examples folder.
  • For the data given in the reference file determine a statistically significant linear model between advertising spend and sales (Regression 1.xlsm).
  • For the data given in the reference file determine a statistically significant linear model between advertising spend, discounts given, incentive program and sales (Regression 1.xlsm).
  • For the data given in the reference file determine a statistically significant quadratic model between X and Y (Regression 1.xlsm).