Stata Commands Class #3 ECO 721

 Stata Commands from Class #3 ECO 721

use C:\DOCUME~1\labuser\LOCALS~1\Temp\anscombe.dta
regress y1x1
regress y1 x1
regress y2 x2
regress y3 x3
regress y4 x4
twoway scatter y1 x1
twoway (scatter y1 x1) (lfit y1 x1)
help lfit
twoway (scatter y2 x2) (lfit y2 x2)
twoway (scatter y3 x3) (lfit y3 x3)
twoway (scatter y4 x4) (lfit y4 x4)
sysuse auto
des
regress price mpg foreign
tab foreign
tab foreign, nolabel
gen lnprice=ln(price)
gen lnmpg = ln(mpg)
regress lnprice lnmpg foreign
regress price mpg foreign
regress price mpg foreign weight
regress lnprice lnmpg foreign
gen mpgsq = mpg*mpg
regress price mpg mpgsq foreign
regress price mpg foreign
twoway function y = 23124.82 + -1298.763*x +20.95049*x^2
help twoway function
sum mpg
twoway function y = 23124.82 + -1298.763*x +20.95049*x^2, range(10 40)
twoway function y = 23124.82 + -1298.763*x +20.95049*x^2, range(10 40) title(this is a graph)
regress price mpg foreign, robust
help regress
regress price
sum y
sum price
twoway function y = 23124.82 + -1298.763*x +20.95049*x^2, range(10 40) title(this is a graph)
twoway (function y = 23124.82 + -1298.763*x +20.95049*x^2) (function y = 23124.82 +1702.625 -1298.763*x +20.95049*x^2) , range(10 40) title(this is a graph)
twoway (function y = 23124.82 + -1298.763*x +20.95049*x^2range(10 40)) (function y = 23124.82 +1702.625 -1298.763*x +20.95049*x^2,range(10 40)) ,  title(this is a graph)
twoway (function y = 23124.82 + -1298.763*x +20.95049*x^2,range(10 40)) (function y = 23124.82 +1702.625 -1298.763*x +20.95049*x^2,range(10 40)) ,  title(this is a graph)
twoway (function y = 23124.82 + -1298.763*x +20.95049*x^2) (function y = 23124.82 +1702.625 -1298.763*x +20.95049*x^2) , range(10 40) title(this is a graph)
regress price mpg mpgsq foreign weight
twoway (function y = 23124.82 + -1298.763*x +20.95049*x^2,range(10 40)) (function y = 23124.82 +1702.625 -1298.763*x +20.95049*x^2,range(10 40)) ,  title(this is a graph)
sum foreign
regress price mpg c.mpg#c.mpg foreign
help factor variable
regress price c.mpg##c.mpg foreign
regress price c.mpg##c.mpg i.foreign#c.mpg
regress price c.mpg##c.mpg i.foreign##c.mpg

No comments: