~~~~~~~~~~~~TO BE COMPLETED USING RSTUDIO~~~~~~~~~~~~~~
~~~~~~~~~~~~(Please display all RCode used)~~~~~~~~~~~~~~
Regression
Is there a relationship between the number of stories a building has and its height? Some statisticians compiled data on a set of n = 60 buildings reported in the World Almanac. You will use the data set to decide whether height (in feet) can be predicted from the number of stories.
(a) Load the data from buildings.txt.
(Note that this is a text file, so use the appropriate instruction.
If you are having trouble uploading the data, open it to see its
contents and type the data in: one vector for heights and one
vector for stories. Ignore the year data.)
buildings.txt
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 40
1981 448 31
1983 538 40
1968 410 27
1927 409 31
1969 504 35
1988 777 57
1987 496 31
1960 386 26
1984 530 39
1976 360 25
1920 355 23
1931 1250 102
1989 802 72
1907 741 57
1988 739 54
1990 650 56
1973 592 45
1983 577 42
1971 500 36
1969 469 30
1971 320 22
1988 441 31
1989 845 52
1973 435 29
1987 435 34
1931 375 20
1931 364 33
1924 340 18
1931 375 23
1991 450 30
1973 529 38
1976 412 31
1990 722 62
1983 574 48
1984 498 29
1986 493 40
1986 379 30
1992 579 42
1973 458 36
1988 454 33
1979 952 72
1972 784 57
1930 476 34
1978 453 46
1978 440 30
1977 428 21
(b) Draw a scatterplot with stories in the x-axis and height in the y-axis. Describe the trend, strength and shape of the relationship between stories and height.
(c) Find the linear correlation coefficient between these variables. How does it support the description you gave in (b)?
(d) Obtain the linear model and summary. Write down the regression equation that relates height with stories. Add the line to the scatterplot.
(e) Test for significance of the regression at = 0.05. State the null and alternative hypotheses. Can the model be used for predictions? Justify your conclusion using the summary in (d).
(f) State the coefficient of determination. What percentage of variation in height is explained by the number of stories?
(g) Draw diagnostic plots (a plot of stories vs. residuals, and a normal probability plot for the residuals). Do assumptions appear to be satisfied?
(h) Obtain a 95% confidence interval for the true value of the slope. How does the interval support your conclusion in (e)?
(i) What is the estimated height of a building that is 45 stories high? Write a concluding sentence supported by your results above.
NOTE: According to the HomeworkLib guidelines I have answered only the first five parts of the question and the rest you can post as another question
a) The data extracted is given below.
H <- c(770, 677, 428, 410, 371, 504, 1136, 695, 551, 550, 568,
504, 560, 512, 448, 538, 410, 409, 504, 777, 496, 386, 530, 360,
355, 1250, 802, 741, 739, 650, 592, 577, 500,469,320, 441,
845,435)
S <- c(54, 47, 28, 38, 29, 38, 80, 52, 45, 40, 49, 33, 50, 40,
31, 40, 27, 31, 35, 57, 31, 26, 39, 25, 23, 102, 72, 57, 54, 56,
45, 42, 36, 30, 22, 31, 52, 29, 34)
(b) SCATTER PLOT:
Scatter plots are useful for interpreting trends in statistical data. As the data shows an uphill pattern as we move from left to right, this indicates a positive relationship between Stories and Height. That is, as the value of variable "Stories" increase (move right), the the value of "Height" tend to increase (move up). Also we could see a linear pattern in the plot, thus there is a positive linear relationship between Stories and Height.
(c) LINEAR CORRELATION COEFFICIENT:
The correlation coefficient between Height and Stories is and it is found to be significant since the p-value is less than significance level . As the sign is positive and it is nearly closer to 1, there is a strong positive linear relationship between Stories and Height.
(d) SIMPLE LINEAR REGRESSION MODEL:
ESTIMATED REGRESSION EQUATION:
Thus from the above output, the estimated regression equation is
given by,
where is the predicted dependent variable
"Height".
is the intercept
is the slope coefficient of the variable "Stories".
X is the independent variable "Stories".
SCATTER PLOT WITH TREND LINE:
(e) SIGNIFICANCE OF INDIVIDUAL
PREDICTOR:
We use t-test to test for significance of
individual predictors.
HYPOTHESIS:
The hypothesis for t test is given by,
From the regression output, the t-test p-value for the slope
coefficient of the variable "Stories" is . Since it is
less than the significance level , we
reject and conclude that the variable "Stories" is
significant variable. And the intercept term is also significant
sinc ethe p-value is less than significance level .
INTERCEPT:
Since the intercept , the mean value of height without
involving the variable "Stories" is .
SLOPE COEFFICIENT:
Since the slope coefficient , it can be interpreted as:
As the number of stories increases by 1 unit, the mean value of
height increases by units.
TEST FOR OVERALL SIGNIFICANCE OF MODEL:
We use F-test to determine overall significance of model.
The hypothesis is given by,
From the regression output, the F-test p-value is which
is less than the significance level , thus we
reject and conclude that the overall model performance
is significant.
~~~~~~~~~~~~TO BE COMPLETED USING RSTUDIO~~~~~~~~~~~~~~ ~~~~~~~~~~~~(Please display all RCode used)~~~~~~~~~~~~~~ Regression Is there a relationship between...
**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...
Listed below are the numbers of people who have been executed in the US in each year from 1976 (the year the US Supreme court’s decision allowing the death penalty to be carried out) to 1994. Use the data to create a chart of execution per year. How has the number of execution varied since 1976? (using excel) Year Number of executions Year Number of executions 1976 0 1986 18 1977 1 1987 25 1978 0 1988 11 1979 2...
YearOMN197011266197176221972632319735051197473381975802219768360197793611978965919791092719801149919811280319821276619831242319841306419851403219861019219871005419888809198992381990105911991991819921026319931004519949747199510199199611054199711784199811560199913501200016173200116853200218508200320329200425768200526647200638458200740960200847136200938538201040305201144477201247334201344979201440855201532460201629939201728249
The precipitations in Sherbrooke have been recorded from 1962 to 2007 Total Precipitation 1132,7 1090,2 911,6 899,9 895,8 1311,5 1095,5 927 1196.3 295,3 1299.1 1155,3 1055,5 960,4 1051,7 1079 881,5 895,5 1173,5 1011 1184.6 1289 1188 Total Precipitation Year 1985 1986 1987 1988 1989 1990 1991 Year 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 952,7 943.2 854.1 944,5 969.6 1034,3 1088,5 247,7 1040,2 1153,6 1281,2...
11.14 The peak-flow data on an annual basis from Cedar River near Austin, MN, are listed in the following table. Plot the flood-frequency curve on lognormal probability paper. Determine the (a) magnitude of a flood having a return period of 100 years (probability of 1%), and (b) probability of a flow of 100 cfs. Peak- flow cfs 7750 5440 Peak- flow cfs Peak- flow cfs Peak- flow cfs Year Year Year 1991 979 3880 2003 8690 1992 2004 3580 1993...
The following table gives the percentage, P, of households with a television set that also have a VCR. (Unlike the data in your textbook, this data is ficticious) 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 |605 Year % having VCR 0.2 0.4 0.8 1.4 2.9 5.4 9.5 16.7 25.4 37.9 46.5 53.8 56.7 (a) During what year does the point of "diminishing returns" (G.e., the inflection point) appear to take place? During the...
HYPOTHESIS TESTING Climate change is a topic of both academic and political interest. The National Climatic Data Center has recorded temperature data since 1800. You can explore their data at: http://data.giss.nasa.gov/gistemp/ The following chart compares the average Land-Surface Air Temperatures for year since 1961 to the 20th century average Land-Surface Air Temperature. Year Temp Change, °C 1961 0.075 1962 0.038 1963 0.079 1964 -0.207 1965 -0.111 1966 -0.031 1967 -0.005 1968 -0.044 1969 0.076 1970 0.028 1971 -0.105 1972 0.001...
Because the Florida manatee population is threatened, the Florida Maatee Sanctuary Act of 1978 was enacted to protect the species. Scientists interested in the relationship between the number of manatee deaths and time collected the data shown in the table. Manatee Deaths 174 163 146 192 201 416 242 232 269 272 325 305 380 276 396 416 Manatee Deaths Year 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 Year 1991...
2.5. Here are data on the number of people bitten by alligators in Florida over a 36-year period. Make two graphs of these data to illustrate why you should always make a time plot for data collected over time a) Make a histogram of the counts of people bitten by alligators. The distribution has an irregular shape What is the midpoint of the yearly counts of people bitten? b) Make a time plot. There is a great variation from year...
FIREARM DEATHS Download the Excel file Firearm.xls for use in this question. The number of deaths due to firearms in the United States between 1968 and 1993 are given in the Excel file. Answer the following using the research hypothesis, "there is a correlation between year and number of firearm deaths in the US." A. What is the value of the correlation coefficient between year and number of firearm deaths? (Answer to 3 decimal places) B. How many degrees of freedom...