Posts

Simple and Multiple Regression with STATA

Image
Chapter Outline   1.0 Introduction 1.1 A First Regression Analysis 1.2 Examining Data 1.3 Simple linear regression 1.4 Multiple regression 1.5 Transforming variables 1.6 Summary 1.7 Self assessment 1.8 For more information 1.0 Introduction This book is composed of four chapters covering a variety of topics about using Stata for regression. We should emphasize that this book is about “data analysis” and that it demonstrates how Stata can be used for regression analysis, as opposed to a book that covers the statistical basis of multiple regression.  We assume that you have had at least one statistics course covering regression analysis and that you have a regression book that you can use as a reference (see the Regression With Stata page and our Statistics Books for Loan page for recommended regression analysis books). This book is designed to apply your knowledge of regression, combine it with instruction on Stata, to perform, understand and interpret regress...

How to recode into new variable in STATA

To recode variables in   Stata, use the   recode   command. To use   recode , you must provide a list of variables to be recoded and the rules associated with that change. For a variable (e.g.,   q1 ) that contains integers ranging from   1   to   7 , to collapse the values into three categories, use: recode q1 1=1 2=1 3/5=2 6=3 7=3 In the example above: The values of   1   and   2   are recoded as   1 .   The values of   3 ,   4 ,   5   are recoded as   2 . Note: The forward slash ( / ) denotes a range of values (e.g., from   3   to   5 ), including the beginning and end of the range.   The values of   6   and   7   are recoded as   3 .   After using   recode , you cannot recover the original values. To recode and store changes into a new variable (e.g.,   new_q1 ), combine   recode   with the   ge...

How to perform test of Normality Data with STATA

In   Stata, you can test normality by either graphical or numerical methods. The former include drawing a stem-and-leaf plot, scatterplot, box-plot, histogram, probability-probability (P-P) plot, and quantile-quantile (Q-Q) plot. The latter involve computing the Shapiro-Wilk, Shapiro-Francia, and Skewness/Kurtosis tests. The examples below are for the variable   score : Graphical methods   Command Plot drawn . stem score stem-and-leaf . dotplot score scatterplot . graph box score box-plot . histogram score histogram . pnorm score P-P plot . qnorm score Q-Q plot   Numerical methods   Command Test conducted . swilk score Shapiro-Wilk . sfrancia score Shapiro-Francia   . sktest score Skewness/Kurtosis Be aware that in these tests, the null hypothesis states that the variable is normally distributed. That means the data is considered normal if > 0.05 good luck