capture log close set more off log using basic_descriptives, text replace /* an example of a basic descriptive analysis. by modifying this basic syntax you can go pretty far in describing relationships in your data. Don't make the mistake of skipping the descriptive analysis in the rush to run a multivariate model. You may miss something important. The goal of the descriptive analysis is to so how close to the "final" answer you can get just using easy to understand methods. y is your dependent variable x w z q independent variables of interest z and q are categorical, x and w are continuous basic syntax there are many more combinations of commands, but this is enough to get started. */ * generate data (you can ignore this part) /* clear set obs 1000 corxz .5 x q2 gen w=int(30*(uniform())) gen e1=invnorm(uniform()) gen e2=invnorm(uniform()) sort e1 gen z=group(2) sort q2 gen q=group(5) gen y=5*x+3*w+2*z+5*e2 replace y=y+10 if q==3 save basic, replace */ * begin syntax clear use basic sum y x w z q cor y x w z q tab q, sum(y) tab q, sum(y) nost nofreq tab q z, sum(y) tab q z, sum(y) nost nofreq scatter y x * see help scatter sum w, det gen w2=recode(w, 0, 5, 10, 15, 20) * help functions tab w2 z, sum(y) egen miss=rowmiss(y x w z q) tab miss * help egen tab q, sum(x) egen avg_x=mean(x), by(q) reg y x avg_x sort q by q: sum y x w z q by q: reg y x z log close