In: Statistics and Probability
~~~~~~~~~~~~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.
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 a = 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?