
Explore data management and statistical analysis with Stata, including data entry, syntax, do-files, descriptive statistics, chi-square tests, t-tests, ANOVA, regression, and visualization.
Learn how to obtain Stata through institutional licenses, short-term access, or purchasing options, and compare IC, SE, and MP versions, durations of 6 months, 1 year, or perpetual.
Stata’s main screen organizes five windows; explore opening data files, counting observations, and using the review, variable, properties, and command windows to run and rerun commands.
Learn to browse and edit data in stata, enter new data, replace values, rename variables, and import excel files, then save your work.
Explore how Stata classifies variables into three groups by color, with string variables in red, value labels in blue, and numeric values in black.
Change the current working directory in Stata with cd, load data with use, and make the folder permanent by setting the default startup directory.
Master the basic Stata command structure, using generate and drop, apply if statements and options, and produce summary statistics and frequency tables with tabulate.
Practice Stata command syntax by loading a dataset, using summarize with detail, and computing descriptive statistics for wage and education, including gender and experience subgroups and the first 500 observations.
Explore tabulate in Stata to create frequency distribution tables for employment status, interpret percentages and cumulative percentages, and perform cross-tabulations with gender.
Practice the tabulate command in Stata with the cps4_small data to create frequency distributions for wage and education, compare categories, and examine gender-based differences with counts and percentages.
Apply the summary command in Stata to obtain descriptive statistics for numdate, including mean, minimum, maximum, standard deviation, and percentiles.
Learn how to use the generate command in Stata to create a new variable like agepass16 and calculate dates per year after turning 16, validating with tab and cross-tabulations.
Use the replace command with an if statement to update values in a variable, such as changing 18 to 19, and create a copy like agecopy to preserve original data.
Create a new isol variable with gen, initialize to 0, then use replace if to code 1 for isolated cases based on numdate and numfriend; verify with tab and cross-tabulation.
Master the recode command in Stata to group daters into minimal, moderate, and frequent categories and create a new variable datelevels while preserving the original numdate.
Master rename, drop, keep, and display commands in Stata to rename variables, drop variables or observations, keep specific observations, and perform calculations.
Data management with Stata demonstrates the motivation for using a do-file to save commands from the current session and reuse them in future sessions, reducing retyping and improving reproducible workflows.
Open, edit, save, and run do-files in Stata using the do-file editor or keyboard shortcuts; execute commands, view results, and document code with // or /* */ comments.
Open the do-file editor, create variable isol with gen and replace to flag isolation by 2 or fewer friends and dates, then compare results with isol1 and save.
Apply variable and value labels in Stata to describe data; define and assign value labels for 0 and 1, then use nolabel if needed.
Learn how to manage missing data in Stata by assigning missing codes. Recode 888 and 999 to missing codes, and examine summary statistics to prevent distortion.
Learn how to handle missing data in Stata by coding with a dot, using recode, and correctly applying if statements to avoid biased results.
Learn to create string variables in Stata with generate and str, assign values like Christian using if conditions, and apply correct spelling, quotes, and or logic across lines.
Explore differences between string and numeric variables in Stata, focusing on missing values: dot vs blank, and learn to replace missing strings with other religion using replace for strings.
Learn to convert string variables to numeric in stata with encode, inspect with tabulate, apply value labels, and save results using copy-paste or a log file.
Explore descriptive statistics in Stata by analyzing a data file with nominal and ordinal variables to create frequency distributions, compare gender groups, and handle missing observations.
Learn to produce histograms in Stata using the point-and-click interface, apply value labels, customize axis titles and colors, and save or copy the underlying commands for reuse.
Use frequency distributions for nominal and ordinal data, and compute mean and standard deviation for interval or ratio variables like bmi with Stata's sum command.
Explore how to obtain detailed summary statistics in Stata with the sum command and detail option, including variance, standard deviation, skewness, kurtosis, range, mean, median, and percentiles.
Learn to use tabstat in Stata to generate customized descriptive statistics for bmi and age, including mean, sd, p50, min, and max, and place results in columns.
Explore how to choose hypothesis tests based on nominal and ordinal variables, perform a chi-squared test in stata, and interpret p-values, association measures (gamma, tau-b), and null versus alternative hypotheses.
Explore the relationship between risk (nominal) and attending college (ordinal) using tabulation, cross-tabulation, and a chi-squared test, with null and alternative hypotheses and Stata recoding.
We assign value labels to recoderisk, apply them, and compare college vs non-college attitudes toward risk using tab and column percentages, then test significance with chi-squared.
Use a chi-square test in Stata to examine whether college education influences risk taking. Compare expected versus observed frequencies and interpret the p-value against the null hypothesis.
Compute and interpret measures of association for nominal and ordinal variables in Stata, focusing on gamma and tau-b, to report strength alongside chi-square significance and explain direction and magnitude.
Apply elaboration to test whether gender changes the relationship between college attendance and willingness to take risk in Stata, including coding gender and interpreting gamma, tau-b, and chi-square.
Please download the attached files for the section six.
distinguishes nominal and ordinal from interval and ratio variables, explains that ratio data like numvolunteer has real-world meaning, and outlines the main question linking denomination to volunteering.
Learn how to prepare data in Stata by handling legitimately skipped cases, recoding .s to 0, and creating a duplicate variable numvolunteercopy for analysis, before constructing a confidence interval.
Construct and interpret confidence interval for the population mean using sample data, understand sampling error, and conduct a one sample t test in stata.
Perform a one sample t test to assess whether the population mean equals a value, such as 3, using Stata, and interpret p-values alongside the confidence interval.
Analyze whether religious denomination affects volunteering using a two-sample t test in Stata, with descriptive statistics and mean differences (5.8 vs 3.57) guiding hypothesis testing.
Perform a two-sample t test to compare mean volunteering between religious and nonreligious groups, and conclude the difference is not zero, with religious volunteers higher (about 5.79 vs 3.57).
Apply analysis of variance (ANOVA) to determine whether religious denomination affects the mean number of times respondents volunteer across six denominations, reporting a significant result (p = .0001).
Please download the attached resources for this section.
Explore the relationship between interval/ratio variables using a scatterplot of workhours versus totalactivities, created by summing religious and nonreligious activities, and exclude outliers to reveal a negative association.
Learn to measure the strength and direction of relationships with the corr command in Stata, using workhours and totalactivities, while noting how missing data affects correlations.
Compute pairwise correlation with p w c o r r for workhours, totalactivities, and marrymin, noting observations and p values to test significance and the relation between workhours and totalactivities.
Compare correlation and regression, explain dependent and independent variables, estimate the sample beta, and interpret intercept and slope with the best-fitting line using a scatterplot, plus p-value testing at .05.
Perform a simple linear regression in Stata linking workhours to totalactivities, obtaining a negative beta of about -1.3 hours per week, with p=0.000 and an intercept of 22.47.
Learn to interpret a simple regression output, focusing on the F statistic and P-value, and understand R-squared (0.023, 2.3%) as the variation in workhours explained by total activities.
Explains multiple linear regression with more than one independent variable, using least squares to estimate coefficients like marrymin and totalactivities on workhours, and assess statistical significance via p-values and r-squared.
Learn to generate fitted values and residuals from a least-squares regression in Stata using predict with xb, store them as new variables, and use them to assess model accuracy.
Learn to use a dichotomous variable in a Stata regression, coding dating as 0/1, handling missing values, and interpreting beta, p-values, and changes in explanatory power.
Explore how to inspect a stata dataset, list observations, generate summary statistics, and create a scatter plot of food expense versus income using twoway with customized axis labels and titles.
Regress food expense on income to obtain fitted values, residuals, and the regression line; use estat for variance-covariance and standard errors, and predict yhat for a new observation.
Learn to fit a quadratic regression in Stata, transforming square feet to square feet squared, generate fitted values, and plot a curve that shows price grows faster for larger houses.
Apply a quadratic regression model in Stata to estimate house prices, derive the slope from the regression coefficient with respect to square feet, and use intercept and coefficient for predictions.
Explore log-linear regression in stata by transforming price with the natural log, diagnosing skew with histograms, and interpreting how square footage affects log price and predicted price.
Explore regression with indicator variables to assess how location near a university campus influences house prices, using histogram visualization and Stata commands to compare near and far scenarios.
Assess how location matters for house prices using a regression with an indicator for university town, showing a 215k intercept and a 61k near-campus premium with a significant t-test.
Note: The course is COMPLETE now.
This course, extended over seven sections, provides a comprehensive introduction to Stata and Statistics. The aim of the course is to teach all the variables, and the relevant Stata commands, used in Statistics. These variables are nominal, ordinal, interval, and ratio variables.
There are two alternative ways to undertake the course.
1. If you have a basic understanding of Stata, you can directly start from section 3, which teaches Data Management. You should then proceed to section 4 on Descriptive Statistics, which is common to all types of research. Section 5 analyses a relationship and interprets it between Nominal/Ordinal variables. Examples of these types of variables are gender, race, employment status, ethnicity, levels of satisfaction, customer service quality, hair color, and religion among others. Section 6 investigates a relationship and interprets it between the Nominal/Ordinal variable and the Interval/Ratio variable. Section 7 finds an effect of one Interval/Ratio variable on another Interval/Ratio variable. Examples of these types of variables are age, income, prices, exam scores, temperature, distance, and area among others. Note: If you adopt this strategy, you may need to go back to the second section, if you have any trouble understanding a particular Stata command in sections 3, 4, 5, 6, and 7. The advantage of this strategy is you will study the more important content first.
2. Alternatively, you can follow the exact order of the course, starting from section 1 and then proceeding to the next section until you reach the section 7. If you follow this strategy, make sure you do not give up in the middle of the course. The research shows that, and this course is not an exception, some students do not complete the entire course. In this course, the first 3 sections are meant to prepare you for the next 4 sections. Therefore, quitting in the first half of the course will deprive you of the intended benefits.
Whichever alternative you choose, you must download the resources and practice with me during the lectures. In addition, you must attempt all exercises given at the end of each section.
Captions: Each video/lecture is accompanied by accurate captions to enhance your comprehension of the course contents.
Resources: You will be provided with a separate data set for each section to practice with me during the lectures. You will also be given a separate data set to attempt the exercises at the end of each section. You will obtain five do-files, one on data management, and the remaining four on data analysis. The only prerequisites for the course are to install Stata on your computer and remain committed.
Good Luck!