Question

In: Statistics and Probability

From the data set myclass.restaurantratings, create - a scatter digram with a regression line between score and price

From the data set myclass.restaurantratings, create - a scatter digram with a regression line between score and price (use REG statement in PROC SGPLOT) Add a title to the scatter diagram and provide a brief discussion on the relationship between the two variables. 

Solutions

Expert Solution

code in sas to get scatterplot only:

PROC SGPLOT DATA=myclass.restaurantratings;

SCATTER X=SCORE Y=PRICE;

TITLE'restaurantratings scatterplot';

RUN;

Run below code to get  scatter digram with a regression line :

You can use the OUTEST= option or the ODS OUPUT statements to save the parameter estimates to a SAS data set. In the following example, the ODS OUTPUT statement saves the ParameterEstimates table to the PE data set:

ods graphics off;

proc reg data=myclass.restaurantratings;
   model price= score;

   ods output ParameterEstimates=PE;

run;

Step 2: Create macro variables

In the PE data set, the ESTIMATE variable contains the parameter estimates. The first row contains the estimate for the intercept term; the second row contains the estimate for the slope. The following DATA step saves these into macro variables:

data _null_;

   set PE;

   if _n_ = 1 then call symput('Int', put(estimate, BEST6.));   

   else            call symput('Slope', put(estimate, BEST6.));

run;

PROC SGPLOT DATA=myclass.restaurantratings noautolegend;

TITLE'regression line with slope and y intercept;

REG Y=PRICE X=SCORE;

INSET "Intercept= &Int" "slope =&slope”/ border title=”Parameter Estimates” position=topleft;

Run;


Related Solutions

Complete the following for the data set: Scatter Plot Calculate the regression line in Y-intercept form...
Complete the following for the data set: Scatter Plot Calculate the regression line in Y-intercept form (do this piece by piece in Excel, or by hand) Interpret in Words your Beta coefficient If X=5; then your Y-hat equals what? Is this a good estimate or not (explain in words) Plot the regression line Use STATA to calculate and interpret the R2 Yi Xi 2 11 4 9 4 14 6 9 8 9 10 8 10 13 11 5 13...
Complete the following for the data set: Scatter Plot Calculate the regression line in Y-intercept form...
Complete the following for the data set: Scatter Plot Calculate the regression line in Y-intercept form (do this piece by piece in Excel, or by hand) Interpret in Words your Beta coefficient If X=5; then your Y-hat equals what? Is this a good estimate or not (explain in words) Plot the regression line Use STATA to calculate and interpret the R2 DATA SET 1: Yi Xi 14 3 11 5 11 3 8 8 5 7 7 10 4 9...
Find the equation of the regression line for the given data. Then construct a scatter plot...
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 significant 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 : 772, 628, 518, 508, 496, 483, y:...
Find the equation of the regression line for the given data. Then construct a scatter plot...
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 significant​ 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 comma x 762 621 515 508 491 480...
Find the equation of the regression line for the given data. Then construct a scatter plot...
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 significant​ 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 comma xHeight, x 766766 620620 520520 508508 494494...
Find the equation of the regression line for the given data. Then construct a scatter plot...
Find the equation of the regression line for the given data. Then construct a scatter plot of the data and draw the regression line.​ (Each pair of variables has a significant​ correlation.) Then use the regression equation to predict the value of y for each of the given​ x-values, if meaningful. The caloric content and the sodium content​ (in milligrams) for 6 beef hot dogs are shown in the table below. font size decreased by 1 font size increased by...
Find the equation of the regression line for the given data. Then construct a scatter plot...
Find the equation of the regression line for the given data. Then construct a scatter plot of the data and draw the regression line.​ (Each pair of variables has a significant​ correlation.) Then use the regression equation to predict the value of y for each of the given​ x-values, if meaningful. The caloric content and the sodium content​ (in milligrams) for 6 beef hot dogs are shown in the table below. font size decreased by 1 font size increased by...
Find the equation of the regression line for the given data. Then construct a scatter plot...
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 significant correlation.) Then use the regression equation to predict the value of y for each of the given x-values, if meaningful. The number of hours 6 students spent for a test and their scores on that test are shown below. font size decreased by 1 font size increased by 1...
Find the equation of the regression line for the given data. Then construct a scatter plot...
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 significant​ 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 comma x 775 619 519 508 491 474...
Find the equation of the regression line for the given data. Then construct a scatter plot...
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 significant​ correlation.) Then use the regression equation to predict the value of y for each of the given​ x-values, if meaningful. The number of hours 6 students spent for a test and their scores on that test are shown below. Hours spent studying, x: 0, 1, 2, 4, 5, 6...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT