# macros

### Free May Craft of Statistical Analysis Webinar: Unlocking the Power of Stata’s Macros and Loops

May 19th, 2016 by

There are many steps to analyzing a dataset. One of the first steps is to create tables and graphs of your variables in order to understand what is behind the thousands of numbers on your screen. But the type of table and graph you create depends upon the type of variable you are looking at.

There certainly isn’t much point in running a frequency table for a continuous variable with hundreds of unique observations. Creating a boxplot to look for outliers doesn’t make much sense if the variable is categorical. Creating a histogram for a dummy variable would be senseless as well.

How should you start this process? Should you create a spreadsheet listing all the names of the variables and list what type of variable they are? Should you paste the names into a Word document?

In this free webinar with Stata expert Jeff Meyer, you will discover the code to quickly determine the type of every variable in a dataset. By simply pressing the execute button on a do-file you will observe Stata placing each variable in a group (the macro) based on the type of variable it is.

You will watch, through the use of loops, Stata create the proper table and graph for each type of variable in a matter of minutes and output the data into a pdf file for future viewing. You will also receive the code to recreate and practice what you’ve learned.

**

Title: Improving Your Productivity by Unlocking the Power of Stata’s Macros and Loops
Date: Thurs, May 26, 2016
Time: 1-2 pm EDT
Presenter: Jeff Meyer

Statistically Speaking members can access this recording from the Analysis Toolbox Resources page at the Programs Center without signing up.

Jeff Meyer is a statistical consultant with The Analysis Factor, a stats mentor for Statistically Speaking membership, and a workshop instructor. Read more about Jeff here.

### Random Intercept and Random Slope Models

July 27th, 2015 by

This free, one-hour webinar is part of our regular Craft of Statistical Analysis series. In it, we will introduce and demonstrate two of the core concepts of mixed modeling—the random intercept and the random slope.

Most scientific fields now recognize the extraordinary usefulness of mixed models, but they’re a tough nut to crack for someone who didn’t receive training in their methodology.

But it turns out that mixed models are actually an extension of linear models. If you have a good foundation in linear models, the extension to mixed models is more of a step than a leap. (Okay, a large step, but still).

You’ll learn what random intercepts and slopes mean, what they do, and how to decide if one or both are needed. It’s the first step in understanding mixed modeling.

Date: Friday, August 21, 2015
Time:
12pm EDT (New York time)
Cost:
Free

### Five Tips and Tricks: How to Make Stata Easier to Use

July 21st, 2015 by

Stata allows you to describe, graph, manipulate and analyze your data in countless ways. But at times (many times) it can be very frustrating trying to create even the simplest results. Join us and learn how to reduce your future frustrations.

This one hour demonstration is for new and intermediate users of Stata. If you’re a beginner, the drop down commands can be extremely daunting.

If you’re an intermediate user and not constantly using Stata, it’s impossible to remember which commands generate the results you are looking to create.

This webinar, by guest presenter Jeff Meyer, will give you five actionable tips (and examples you can re-use) that will make your next analysis in Stata much simpler.

We’ll explore:

• Save time with a do-file to create the table you want exactly as you want.
• A few methods (some easier than others) to create dummy variables out of a categorical variable with several categories
• At least three ways to insert a table into a document
• Quickly alter the looks of your graphs through the use of macros
• How to aggregate data to the group level based on a number of parameters

Date: Wednesday, July 29, 2015
Time:
4pm EDT (New York time)
Cost:
Free

Statistically Speaking members can access this recording from the Analysis Toolbox Resources page at the Programs Center without signing up.

Our next free webinar is titled: “Random Intercept and Random Slope Models” and is coming up in August

Jeff Meyer is a statistical consultant with The Analysis Factor, a stats mentor for Statistically Speaking membership, and a workshop instructor. Read more about Jeff here.

### Macros in Stata, Why and How to Use Them

October 17th, 2014 by

We finished the last article about Stata with the confusing coding of:

local continuous educat exper wage age

foreach var in `continuous'{
graph box `var’, saving(`var’,replace)
}

I admit it looks like a foreign language.  Let me explain how simple it is to understand. (more…)