Please write the codes in
MATLAB.
%we are supposed to answer 1 question at a time
%HW8_4
clear
clc
close all
x=1:10;
y=[26.7 20.2 16.8 15.3 15.1 9.3 5.1 2.8 -1.1 -8.4];
%y=mx+c
p1=polyfit(x,y,1);
plot(x,y,'*',x,p1(1)*x+p1(2))
xlabel('x')
ylabel('y')
title(sprintf(' y = (%f) x + (%f)',p1))
legend('Data points','Linear fit')
sse=sum((y-polyval(p1,x)).^2);
ssto=sum((y-mean(y)).^2);
r21=1-sse/ssto;
fprintf(' y = (%f) x + (%f)\n',p1)
fprintf(' R squared value: %f\n',r21)
fprintf(' value of y when x = 7.2: %f\n',p1(1)*7.2+p1(2))
%x = ym + c
p2=polyfit(y,x,1);
figure
plot(y,x,'*',y,p2(1)*(y)+p2(2))
ylabel('x')
xlabel('y')
title(sprintf(' x = (%f) y + (%f)',p2))
legend('Data points','Linear fit')
sse=sum((x-polyval(p2,y)).^2);
ssto=sum((x-mean(x)).^2);
r22=1-sse/ssto;
fprintf(' x = (%f) y + (%f)\n',p2)
fprintf(' R squared value: %f\n',r22)
fprintf(' value of x when y = 15: %f\n',p2(1)*15+p2(2))
HW8_4 Fit the data in the table using linear regression. Plot the data points as well as the regr...
Exercise 2. Consider the iris data set. (a) Fit a linear regression model for Sepal.Width using Sepal.Length and Species as predictors. Recall that Species is a categorical variable with 3 levels (setosa versicolor, and virginica). Use summary) to print the results. What is the base- line level for Species in the model? (b) Fit a linear regression model for Sepal.Width using Sepal.Length, Species, and the interaction between Sepal.Length and Species as predictors. Use summary ) to print the results. (c)...
please solve using matlab
4. Nonlinear Regression Fit the below data with the following curve-fit equation y bi (ebr + 2 1.0000 1.5431 3.7622 10.0677 27.3082 Define a function of the sum of squared residuals (fSSR) as a function of the regression coefficients, b's. Minimize the fSSR function and determine the regression coefficients. Guess what would be the built-in math function to generate the original data? Plot the function in the existing figure with a smooth dashed line, calculate the...
Using the data file provided with both variables, x and y, answer the following questions using Excel*: 1.Create a scatterplot with the data. Comment on direction, form, strength, outliers and/or other significant findings. 2.Use the linear model to fit a line to the data and determine the equation ỹ = b0 + b1x and Interpret b0and b1. 3.Calculate the coefficient of correlation. Discuss the strength of correlation between the explanatory and response variables. 4.Predict the value for ỹ when you...
Using the Linear Regression Fit Line: y=0.409x+2.963, calculate a forecast for the 18th month. 2 Pts Actuals 12 0.4093x+2 9632 10 Calculate a Forecast for Month 18 18th Month Forecast a) b) Does this look like a good use of a regression approach & why? c) List any concerns you 2 might have if I asked you to forecast month 24 with the data for months 1 through 17 only? 0123456789 10 11 12 13 14 15 16 17 18
Find the equation of the regression line for the given data. Then construct a scatter plot of the data and draw the regression line. (The pair of variables have a significa correlation.) Then use the regression equation to predict the value of y for each of the given x-values, if meaningful. The table below shows the heights (in feet) and the number of stories of six notable buildings in a city. Height, x 758 621 518 510 492 483 (a)...
4. (35 points) Use multiple linear regression to fit the following experimental data, 12 1 4 5.5 1.5 5 y 13 22 16 9 9 (a) Compute the coefficients, the coefficient of determination , the standard deviation Sy, and the standard error of the estimate S/. Show your calculations. (b) Write a MATLAB script that solves part (a).
please help me answer these questions based on the data
Part 5: Correlation, Regression, and Goodness-of-fit test analysis. (20 pts) Using the midpoints as the x-variable and the frequencies as the y-variable of the different data sets of both groups of players, complete the following: I. Graph the scatterplot of points (x, y) to determine the outliers and influential points. Calculate the value for the Linear Correlation Coefficient (r) and give the interpretation. Using a significance level of 0.05, determine...
Question 12 [15 Points] Show proper work. Topic: Linear regression The following data represents the number of full-time employees (x) and the number of job openings postedly) for the top 10 hospitals in Boston metro area (Source: Boston Medical Journal 2009). 2450 3900 9600 9900 13235 1900 5530 6700 7785 4300 210 280 490 565 625 175 435 420 680 350 Consider the following: Exy - 32,536,925 Ex544,958,625 Zyl. 2,053,600 Ex-_65,315 Ey - 4,230 PLEASE DO DETAILED WORK IN THE...
d. We will use pinv function to find a linear regression model to map the measurement data to truth data. Our model will be Y-AX. Y is the truth data matrix Y [ yı; y2i yai ya; ysi yg: y7 ]. A is the tmeasurement data matrix A=[ 1 mh; 1 m2. 1 mai 1 m4; 1 ms: 1 mt 6:1 m7 I . and X-[Xo: x1] is the coefficient of your regression model. Truth Data yn -1 0 Measurement...
linear stat modeling & regression
1) Consider n data points with 3 covariates and observations {xn, ^i2, xi3,yid; i,,n, and you fit the following model, y Bi+Br2+Br+e that is yi A) +Ari,1 +Ari,2 +Buri,3 + єї where є,'s are independent normal distribution with mean zero and variance ơ2 . H the vectors of (Y1, . . . ,Yn). Assume the covariates are centered: Σίχί,,-0, k = 1,2,3. ere, n = 50, Let L are Assume, X'X is a diagonal matrix...