INDUSTRY4.0 ENERGY AUDITING CALCULATIONS
Budget: ₹750 – ₹1,250 INR
Problem 1
Suppose we have a data set with five predictors, X1 = GPA, X2 = IQ, X3 = Gender (1 for Female and 0 for Male), X4 = Interaction between GPA and IQ, and X5 = Interaction between GPA and Gender. The response is starting salary after graduation (in thousands of dollars). Suppose we use least squares to fit the model, and get ?0 = 50, ?1 = 20, ?2 = 0.07, ?3 = 35, ?4 = 0.01, ?5 = 10.
• Which is correct and why?
• For a fixed value of IQ and GPA, males earn more on average than females.
• For a fixed value of IQ and GPA, females earn more on average than males.
• For a fixed value of IQ and GPA, males earn more on average than females provided that the GPA is high enough.
• For a fixed value of IQ and GPA, females earn more on average than males provided that the GPA is high enough.
• Predict the salary of a female with IQ of 110 and a GPA of 4.0
• True or false: Since the coefficient for the GPA/IQ interaction term is very small, there is very little evidence of an interaction effect. Justify your answer.
Problem 2
This problem involves the use of simple linear regression on the Auto data set (see attached "auto.csv").
• Use the ordinary least square (OLS) function contained in "statsmodels.formula.api" python module to perform a simple linear regression with "mpg" as the response and "horsepower" as the predictor. Use the "summary()" function to print the OLS regression results. Comment on the output.
• Is there a relationship between the predictor and the response?
• How strong is the relationship between the predictor and the response?
• Is the relationship between the predictor and the response positive or negative?
• What is the predicted mpg associated with a horsepower of 98?
• What are the associated 95 % confidence and prediction intervals?
• Plot the response and the predictor. Use an appropriate function to display the least squares regression line in the plot.
• Plot the fitted values and the residuals (known as the Residuals vs. Fitted diagnostic plot). The plot shows whether the residuals have non-linear patterns.
Problem 3
This problem involves the use of multiple linear regression on the Auto data set (see attached "auto.csv").
• Produce a scatterplot matrix which includes all of the variables in the data set.
• Compute the matrix of correlations between the variables using the Pandas' corr() function.
• Use the ordinary least square (OLS) function contained in "statsmodels.formula.api" python module to perform a multiple linear regression with "mpg" as the response and all other variables except "name" as the predictors. Use the "summary()" function to print the OLS regression results. Comment on the output. For example,
• Is there a relationship between the predictors and the response?
• Which predictors appear to have a statistically significant relationship to the response?
• What does the coefficient for the "year" variable suggest?
• Plot the fitted values and the residuals (known as the Residuals vs. Fitted diagnostic plot). The plot shows whether the residuals have non-linear patterns.
• Do any of the following interactions appear to be statistically significant?
• Interaction between horsepower and year
• Interaction between displacement and weight
• Interaction between horsepower and origin
• Interaction between horsepower and weight
• Interaction between displacement and year
Note that you can use the * and : symbols to fit linear regression models with interaction effects. For example, in the OLS function, x:y includes an interaction term between x and y, while x*y is shorthand for x +yb + x:y, that is, it includes x and y as well.
Suppose we have a data set with five predictors, X1 = GPA, X2 = IQ, X3 = Gender (1 for Female and 0 for Male), X4 = Interaction between GPA and IQ, and X5 = Interaction between GPA and Gender. The response is starting salary after graduation (in thousands of dollars). Suppose we use least squares to fit the model, and get ?0 = 50, ?1 = 20, ?2 = 0.07, ?3 = 35, ?4 = 0.01, ?5 = 10.
• Which is correct and why?
• For a fixed value of IQ and GPA, males earn more on average than females.
• For a fixed value of IQ and GPA, females earn more on average than males.
• For a fixed value of IQ and GPA, males earn more on average than females provided that the GPA is high enough.
• For a fixed value of IQ and GPA, females earn more on average than males provided that the GPA is high enough.
• Predict the salary of a female with IQ of 110 and a GPA of 4.0
• True or false: Since the coefficient for the GPA/IQ interaction term is very small, there is very little evidence of an interaction effect. Justify your answer.
Problem 2
This problem involves the use of simple linear regression on the Auto data set (see attached "auto.csv").
• Use the ordinary least square (OLS) function contained in "statsmodels.formula.api" python module to perform a simple linear regression with "mpg" as the response and "horsepower" as the predictor. Use the "summary()" function to print the OLS regression results. Comment on the output.
• Is there a relationship between the predictor and the response?
• How strong is the relationship between the predictor and the response?
• Is the relationship between the predictor and the response positive or negative?
• What is the predicted mpg associated with a horsepower of 98?
• What are the associated 95 % confidence and prediction intervals?
• Plot the response and the predictor. Use an appropriate function to display the least squares regression line in the plot.
• Plot the fitted values and the residuals (known as the Residuals vs. Fitted diagnostic plot). The plot shows whether the residuals have non-linear patterns.
Problem 3
This problem involves the use of multiple linear regression on the Auto data set (see attached "auto.csv").
• Produce a scatterplot matrix which includes all of the variables in the data set.
• Compute the matrix of correlations between the variables using the Pandas' corr() function.
• Use the ordinary least square (OLS) function contained in "statsmodels.formula.api" python module to perform a multiple linear regression with "mpg" as the response and all other variables except "name" as the predictors. Use the "summary()" function to print the OLS regression results. Comment on the output. For example,
• Is there a relationship between the predictors and the response?
• Which predictors appear to have a statistically significant relationship to the response?
• What does the coefficient for the "year" variable suggest?
• Plot the fitted values and the residuals (known as the Residuals vs. Fitted diagnostic plot). The plot shows whether the residuals have non-linear patterns.
• Do any of the following interactions appear to be statistically significant?
• Interaction between horsepower and year
• Interaction between displacement and weight
• Interaction between horsepower and origin
• Interaction between horsepower and weight
• Interaction between displacement and year
Note that you can use the * and : symbols to fit linear regression models with interaction effects. For example, in the OLS function, x:y includes an interaction term between x and y, while x*y is shorthand for x +yb + x:y, that is, it includes x and y as well.