This is a question about writting R code for a linear regression model. 8. . (13 marks) Given four points (1,0.8)...
Question 3. Multiple linear regression [6 marks] Create a multiple linear regression model, including as explanatory variables wt, am and qsec. To run multiple linear regression to predict variable A based on variables B, C and D you need to use R’s linear model command, Im as follows, storing the results in an object I'll call regm. regm <- lm (A B + C + D) summary(regm) Report the output from the relevant summary() command. Explain why the R2 and...
Question 6 (10 marks) Finally, the researcher considers using regression analysis to establish a linear relationship between the two variables – hours worked per week and yearly income. a) What is the dependent variable and independent variable for this analysis? Why? (2 marks) b) Use an appropriate plot to investigate the relationship between the two variables. Display the plot. On the same plot, fit a linear trend line including the equation and the coefficient of determination R2 . (2 marks)...
hello this is about linear regression i want answer the question using R write the results and command of R A marketing researcher studied annual sales of a product that had been introduced 10 years ago. The data are as follows, where X is the year (coded) and Y is sales in thousands 1 VI X;: 2 135 3 162 4 178 5 221 6 232 5 7 283 6 8 306 7 9 374 8 10 395 9 98...
The Book of R (Question 20.2) Please answer using R code. Continue using the survey data frame from the package MASS for the next few exercises. The survey data set has a variable named Exer , a factor with k = 3 levels describing the amount of physical exercise time each student gets: none, some, or frequent. Obtain a count of the number of students in each category and produce side-by-side boxplots of student height split by exercise. Assuming independence...
PLEASE ANSWER ALL parts . IF YOU CANT ANSWER ALL, KINDLY ANSWER PART (E) AND PART(F) FOR PART (E) THE REGRESSION MODEL IS ALSO GIVE AT THE END. REGRESSION MODEL: We will be returning to the mtcars dataset, last seen in assignment 4. The dataset mtcars is built into R. It was extracted from the 1974 Motor Trend US magazine, and comcaprises fuel consumption and 10 aspects of automobile design and performance for 32 automobiles (1973-74 models). You can find...
For Questions 4-11, use the swiss dataset, which is built into R. Fit a multiple linear regression model with Fertility as the response and the remaining variables as predictors. You should use ?swiss to learn about the background of this dataset. 7. 1 Run Reset Create a 95% confidence interval for the average Fertility for a Swiss province in 1888 with: 40% of males involved in agriculture as occupation 28% of draftees receiving highest mark on army examination 10% of...
8. (20 marks) One end A of an elastic string was attached to a horizontal bar and a mass m grams, was attached to the other end B. The mass was suspended freely and allowed to settle vertically below A. The length AB. Imm, was recorded, for various masses as follows: m100 200 300 400 500 600 228 236 256 278 285 301 Part of the output from fitting the simple linear regression for predicting the length 1 from mass...
01:37:49 Question 2of 28 Step 1 of 4 A regression Analysis has been performed to estimate the model and the output is given. Regression Statistics 91092 82977 80140 23581 ultiple R justed R Square tandard Error bservations 8 ANOVA gnificance F 00165 df SS 24652 gression esidual otal 1,62635 0.05561 1,62635 33365 96000 -Upper 95% tStat 1430070 -5.40789 P-value 0.00001 00165 Lower 95% tandard Error 22648 13923 fficients 23882 0.75294 Ne Prev 68465 1.09362 9300 41226 ntercept iles Step 1...
For this exercise we will run a regression using Swiss demographic data from around 1888. The sample is a cross-section of French speaking counties in Switzerland This data come with the R package datasets. The first step is to load the package into your current environment by typing the command libraryldatasets) in to the R console. This loads a number of datasets including one called swiss. Type help/swiss) in the console for additional details. The basic variable definitions are as...
1. For each of the following regression models, write down the X matrix and 3 vector. Assume in both cases that there are four observations (a) Y BoB1X1 + B2X1X2 (b) log Y Bo B1XiB2X2+ 2. For each of the following regression models, write down the X matrix and vector. Assume in both cases that there are five observations. (a) YB1XB2X2+BXE (b) VYBoB, X,a +2 log10 X2+E regression model never reduces R2, why 3. If adding predictor variables to a...