Listed options trading hours24 comments
Forex binary options trading software on youtube indicator with
This page is under construction!! In this chapter, we will further explore the use of categorical predictors, including using categorical predictors with more than 2 levels, 2 categorical predictors, interactions of categorical predictors, and interactions of categorical predictors with continuous predictors. We will focus on the understanding and interpretation of the results of these analyses.
We hope that you are familiar with the use of categorical predictors in ordinary least squares OLS regression, as described in Chapter 3 of the Regression with Stata book. Understanding how to interpret the results from OLS regression will be a great help in understanding results from similar analyses involving logistic regression. This chapter will use the apilog data that you have seen in the prior chapters. We will focus on four variables hiqual as the outcome variable, and three predictors, the proportion of teachers with full teaching credentials cred , the level of education of the parents pared , and the percentage of students in the school receiving free meals meals.
Below we show how you can load this data file from within Stata. The predictor that we will use is based on the proportion of teachers who have full credentials. We have divided the schools into 3 categories, schools that have a low percentage of teachers with full credentials, schools with a medium percentage of teachers with full credentials and schools with a high percentage of teachers with full credentials.
We will refer to these schools as high credentialed , medium credentialed and low credentialed schools. Below we show the codebook information for this variable. The variable cred is coded 1, 2 and 3 representing low , medium and high respectively. Before we run this analysis using logistic regression, let us look at a crosstab of hiqual by cred. Looking at the Pearson Chi Square value But such a way of looking at these results is very limiting.
Instead, lets look at this using a regression framework. Below we show how we could include the variable cred as a predictor and hiqual as an outcome variable in an OLS regression.
We use the xi command with i. We can use the adjust command to get the predicted values for the 3 levels of cred as shown below. Note that the low credentialed schools are the omitted group. The coefficient for the constant corresponds to the predicted value for the low credentialed group. Seeing how you interpret the parameter estimates in OLS regression will help in the interpretation of the parameter estimates when using logistic regression. As you see below, the syntax for running this as a logistic regression is much like that for an OLS regression, except that we substituted the logit command for the regress command.
The results are shown using logistic regression coefficients where the coefficient represents the change in the log odds of hiqual equaling 1 for a one unit change in the predictor. Some prefer to use odds ratios to help make the coefficients more interpretable. The odds ratio is simply the exponentiated version of the logistic regression coefficient. For example, exp 1. Referring back to the crosstabulation of hiqual and cred , we can reproduce these odds ratios.
First, using the frequencies from that crosstab, we can manually compute the odds of a school being high-quality school at each level of cred. The above technique works fine in a simple situation, but if we had additional predictors in the model it would not work as easily. Below we demonstrate the same idea but using the adjust command with the exp option to get the predicted odds of a school being high-quality school at each level of cred.
Indeed, we see this is correct. Indeed, we see this is correct as well. The odds of a high credentialed school being high quality which is 1. If this were a linear model e. We can test the overall effect of cred in one of two ways. First, we could use the test command as illustrated below. This produces a Wald Test. Based on the results of this command, we would conclude that the overall effect of cred is significant.
Instead, you might wish to use a likelihood ratio test, illustrated below. We first run the model with all of the predictors, i.
Next, we run the model omitting the variable s we wish to test, in this case, omitting i. We can then use the lrtest command to compare the current model specified as a period to the model we named full. This test is also clearly significant.
If you look back to the crosstab output of hiqual and cred you will see a line that reads. Both of these tests use a likelihood ratio method for testing the overall association between cred and hiqual. Note that the medium group has been omitted.
This is not a customary thing to do, but this will be useful to us later. Again, note that the medium group has been omitted. Note that the above example used the odds for low parent education schools. Note that we get the same results if we use the odds for high parent education schools, as illustrated below. The above results indicate that the odds of being a high quality school for high credentialed schools is about Because we did not include an interaction in this model, it assumes that the impact of credentials is the same regardless of the level of education of the parents.
As we saw above, the odds ratio comparing high versus low credentialed schools was the same Below we see the predicted probabilities. Below we see the actual probabilities of the schools being high quality broken down by the 4 cells. When parents education is low, the observed odds ratio is about When parents education is high the observed odds ratio for cred is about 7.
As you see, when we included just main effects in the model, the overall odds ratio for cred was These odds ratios seem considerably different, yet because we only included main effects the model, the model just estimates one overall odds ratio for cred.
However, if we include an interaction term in the model, then the model will estimate these odds ratios separately. We explore this further using the odds ratio metric below. The odds ratio for the interaction is actually the ratio of two odds ratios. As you see below, the ratio of these two odds ratios is the interaction.
Here is another way to look at this. If we multiply this by the interaction term by. As we see below, In particular, when parent education is low, the odds of high credentialed schools being high quality are 27 times than the odds of low credentialed schools being high quality.
For the high parent education schools, the odds of high credentialed schools being high quality is about 7. We will use this example to illustrate how to run and interpret the results of such an analysis.
As above, we will start with a model which includes just main effects, and then will move on to a model which includes both main effects and an interaction. We use the xi prefix with i.
As we would have expected based on the individual tests, the overall effect of parents education is not significant. We illustrate this below. The above odds ratio was computed when parents education is low, but we get the same result if we use medium or high parent education. These last two effects were computed when credentials was low. If we had computed them when credentials was high , we would have gotten the same result you can try it for yourself. This model with main effects is assuming that these odds ratios will be roughly the same, but we can look at them and see if this appears reasonable.
The analysis above only included main effects of parent education and the credentials of the teachers, but did not include an interaction of these two variables. The analysis below includes this interaction. Previously we have used the adjust command to obtain predicted odds. We can then use these values to illustrate the meaning of the odds ratios from the above model.
This is shown below, illustrating that when parent education is low, the odds of a high credentialed school being high quality is about 27 times that of a low credentialed school. We illustrate this below, which shows that when when teacher credentials are low, schools with medium parent education have an odds or being high quality that is about 1. We can illustrate this below. This effect is statistically significant. We should emphasize that when you have interaction terms, it is important to be very careful when interpreting any of the terms involved in the interaction.
However, because this term was part of an interaction, the interpretation is different. It is not the overall effect of high versus low education, but it is this effect when the other terms in the interaction are at the reference category i.
All of the prior examples in this chapter have used only categorical predictors. In chapter 1, we saw models which included categorical predictors, continuous predictors, and models that included categorical and continuous predictors.
This section will focus on models that include both continuous and categorical predictors, as well as models that include interactions between a continuous and categorical predictor. We would like to make a graph which shows the predicted value for low credentialed and high credentialed using separate lines for each type of school. To do this, we need to make a separate variable that has the predicted value for the low credentialed and high credentialed schools.
We can now show a graph of the predicted values using separate lines for the two types of schools. The coefficient for meals is -. Note that the units in this graph are the log odds of a school being high quality.
Rather than focusing on the particular meaning of these coefficients, we wish to emphasize that the predicted logits in this model for the two groups form 2 parallel lines.