Ques 5
R codes
> data("stackloss")
> data = stackloss
> head(data)
Air.Flow Water.Temp Acid.Conc. stack.loss
1 80 27 89 42
2 80 27 88 37
3 75 25 90 37
4 62 24 87 28
5 62 22 87 18
6 62 23 87 18
> attach(data)
The following object is masked _by_ .GlobalEnv:
stack.loss
The following objects are masked from data (pos = 3):
Acid.Conc., Air.Flow, stack.loss, Water.Temp
The following object is masked from package:datasets:
stack.loss
> plot( Water.Temp,stack.loss, main = 'problem 4.a',xlab =
'Water.Temp', ylab = 'stack.loss', lwd = 2)
> cor(Water.Temp,stack.loss)
[1] 0.8755044
b) There is linear relationship between two variables.
c)
Sample reg equation:
> reg = lm(stack.loss~Water.Temp)
> reg
Call:
lm(formula = stack.loss ~ Water.Temp)
Coefficients:
(Intercept) Water.Temp
-41.911 2.817
> plot( Water.Temp,stack.loss, main = 'problem 4.a',xlab =
'Water.Temp', ylab = 'stack.loss', lwd = 2)
> abline(reg, col='red', lwd = 2)
>
From plot we can see that sample regression fits the data quite well.
d)
> plot( Water.Temp,stack.loss, main = 'problem 4.a',xlab =
'Water.Temp', ylab = 'stack.loss', lwd = 2)
> abline(reg, col='red', lwd = 2)
> abline(v = mean(Water.Temp))
> abline(h = mean(stack.loss))
Thus sample regression equation passes through = (mean(Water.Temp),mean(stack.loss))
> mean(stack.loss)
[1] 17.52381
> mean(Water.Temp)
[1] 21.09524
Please make sure you write the R cude, R-PROGRAM Data was collected in order to investigate...
Data was collected in order to investigate the effect of temperature on the yield of a chemical process. Temperatures were set at eight specific levels, and the yield was determined for five replications at each level 4. Identify the response variable and the predictor variable. Explain your reasoning. Describe the two sources of variation (variation due to regression and variation about the regression) in terms of this particular problem (using the variables described above). In this particular case, are we...
R programming question. Please use #comments too ! 1. The data set UN11 in the alr4 package contains several variables, including ppgdp, per capita gross domestic product in US dollars, and fertility, number of children per woman, from the year 2009-2011. The data are for 199 localities, and we will study the regression of ppgdp on fertility (a) Draw the scatterplot of ppgdp against fertility and describe the relationship between these two variables. Is the trend linear? nD the simple...
Homework 4 Use the hand span data that we collected in class for homework Suppose you want to buy someone a pair of love, but you do not know their love size. Usually, we do have a pretty good idea of the person's height. Let' asume that the right hand span is a rood indicator of the love size. So let find the best predictor of right hand span be on the person's height. Once we can predict the right...
USE R STUDIO The stackloss data frame available in R contains 21 observations on four variables taken at a factory where ammonia is converted to nitric acid. The first three variables are Air.Flow, Water.Temp, and Acid.Conc. The fourth variable is stack.loss, which measures the amount of ammonia that escapes before being absorbed. Read the help file for more information about this data frame. - Give a numerical summarization of each column of the dataset, then use boxplots to help illustrating...
Correlation This assignment will examine your ability to analyze the relationship between two variables, create an equation for predicting one variable from the other, and to critique the results of the data. You will be given the data for 2 psychological experiments looking at the relationship between variables. For these sets of data you will: (1) use the SPSS program to calculate the correlation and create a scatterplot (2) provide the appropriate output given from the program (3) describe this...
Problem: You are interested in factors that predict the salaries of catwalk models. You collected data from 231 models (attached SPSS data file: supermodel_1.sav). For each model, you asked: salary per day in dollars (on days when working (variable: salary_2), age (variable: age), and how many years they have worked as a model (variable: years). You also got a panel of experts from various modeling agencies to rate the attractiveness of each model as a percentage, with 100% being perfectly...
PLEASE ANSWER CLEARLY The earth's climate is getting warmer. The most common theory attributes the increase to atmospheric levels of carbon dioxide (CO2), a greenhouse gas. Here is a scatterplot showing the mean annual CO2 concentration in the atmosphere, measured in parts per million (ppm) at the top of Mauna Loa in Hawaii and the mean annual air temperature over both land and sea across the globe, in degrees Celsius for the years 1959 to 2011. Linear Regression Output Scatterplot...
1. The data set UN11 in the alr4 package contains several variables, including ppgdp, per capita gross domestic product in US dollars, and fertility, number of children per woman, from the year 2009-2011. The data are for 199 localities, and we will study the regression of ppgdp on fertility. (a) Draw the scatterplot of ppgdp against fertility and describe the relationship between these two variables. Is the trend linear? (b) Replace both variables by their natural logarithms and draw another...
**R-STUDIO KNOWLEDGE REQUIRED*** PLEASE ANSWER THE FOLLOWING WITH ****R-STUDIO**** CODING- thank you so much!! I am specifically look for the solution to part ***(h)**** and *****(i)***** below using R-Studio code: The data set in question is: YEAR Height Stories 1990 770 54 1980 677 47 1990 428 28 1989 410 38 1966 371 29 1976 504 38 1974 1136 80 1991 695 52 1982 551 45 1986 550 40 1931 568 49 1979 504 33 1988 560 50 1973 512...
For the following exercises you can use the 'Wooldridge' package in R to load the data 9. (7 marks) (using dataset: "k401k") The data in 401K are a subset of data analyzed by Papke (1995) to study the relationship between participation in a 401(k) pension plan and the generosity of the plan. The variable prate is the percentage of eligible workers with an active account; this is the variable we would like to explain. The dummy variable sole represents whether...