# Exercise # plot the graph with fitted line gnuplot price sqft --output=display # runs regression of sqft on prices ols price const sqft # saves the predicted values for the price series yhat1=$yhat gnuplot yhat1 sqft --output=display # saves the residuals genr resid1=price-yhat1 # generates the squared variable sqft genr sqft2=sqft^2 gnuplot sqft resid1 --output=display corr resid1 sqft # OLS of sqft squared on prices ols price const sqft2 series yhat2=$yhat genr resid2=price-yhat2 corr resid2 sqft gnuplot sqft resid2 --output=display # calculating the impact of increasing the size of apartment on prices scalar slope_2000=2*$coeff(sqft2)*2000