Search Results

Keyword: ‘advanced’

Advanced Mata: Pointers

I’m still recycling my talk called “Mata, The Missing Manual” at user meetings, a talk designed to make Mata more approachable. One of the things I say late in the talk is, “Unless you already know what pointers are and know you need them, ignore them. You don’t need them.” And here I am writing about, of all things, pointers. Well, I exaggerated a little in my talk, but just a little.

Before you take my previous advice and stop reading, let me explain: Mata serves a number of purposes and one of them is as the primary langugage we at StataCorp use to implement new features in Stata. I’m not referring to mock ups, toys, and experiments, I’m talking about ready-to-ship code. Stata 12’s Structural Equation Modeling features are written in Mata, so is Multiple Imputation, so is Stata’s optimizer that is used by nearly all estimation commands, and so are most features. Mata has a side to it that is exceedingly serious and intended for use by serious developers, and every one of those features are available to users just as they are to StataCorp developers. This is one of the reasons there are so many user-written commands are available for Stata. Even if you don’t use the serious features, you benefit. Read more…

Categories: Mata Tags: , ,

Creating tables of descriptive statistics in Stata 18: The new dtable command

In Stata 17, we introduced the new collect suite of commands for creating and customizing tables and the etable command for easily creating and exporting a table of estimation results. Stata 18 offers another new command, dtable, that easily builds and exports a table of descriptive statistics, often called Table 1 in publications. Now generating tables of descriptive statistics for both categorical and continuous variables is easier than ever. It is worth mentioning that the twin commands etable and dtable are both built on the collect framework we introduced in Stata 17, so they share a lot of properties.

In this post, I’ll demonstrate how to create and export simple tables of descriptive statistics and more complex ones that display statistics by group, test for differences across groups, and more. I will also show how you can use the collect suite of commands to further customize the look of your tables and how to include tables created with dtable in complete reports.

Read more…

Just released from Stata Press: Microeconometrics Using Stata, Second Edition

Stata Press is pleased to announce the release of Microeconometrics Using Stata, Second Edition, Volumes I and II, by A. Colin Cameron and Pravin K. Trivedi. This book not only debuted as Kindle’s #1 New Release but also immediately ranked high on Kindle’s competitive best-seller lists in categories such as Statistics, Microeconomics, Econometrics & Statistics, Education Software, Education Statistics, and Mathematical & Statistical. Read more…

Just released from Stata Press: An Introduction to Stata for Health Researchers, Fifth Edition

Stata Press is pleased to announce the release of An Introduction to Stata for Health Researchers, Fifth Edition, by Svend Juul and Morten Frydenberg. This book debuted at #1 on Kindle’s new release list for Probability & Statistics and debuted on the top ten list on Kindle’s new release list for Mathematics. Read more…

Customizable tables in Stata 17, part 2: The new collect command

In my last post, I showed you how to use the new-and-improved table command to create a table and how to use some of the options to customize the table. In this post I want to introduce the collect commands. Many Stata commands begin with collect, and they can be used to create collections, customize table layouts, format the numbers in the tables, and export tables to documents. There are so many new collect commands that we created a new Customizable Tables and Collected Results Reference Manual. Today, I want to show you how to use some of the collect commands to customize the look of your tables. I will show you more advanced uses of collect in future posts. Read more…

Just released from Stata Press: Interpreting and Visualizing Regression Models Using Stata, Second Edition

Stata Press is pleased to announce the release of Interpreting and Visualizing Regression Models Using Stata, Second Edition by Michael N. Mitchell.

Mitchell’s latest book is a clear treatment of how to carefully present results from model-fitting in a wide variety of settings. It is a boon to anyone who has to present the tangible meaning of a complex model clearly, regardless of the audience. Read more…

Using the lasso for inference in high-dimensional models

Why use lasso to do inference about coefficients in high-dimensional models?

High-dimensional models, which have too many potential covariates for the sample size at hand, are increasingly common in applied research. The lasso, discussed in the previous post, can be used to estimate the coefficients of interest in a high-dimensional model. This post discusses commands in Stata 16 that estimate the coefficients of interest in a high-dimensional model. Read more…

The book that Stata programmers have been waiting for

“The book that Stata programmers have been waiting for” is how the Stata Press describes my new book on Mata, the full title of which is

The Mata Book: A Book for Serious Programmers and Those Who Want to Be

The Stata Press took its cue from me in claiming that it this the book you have been waiting for, although I was less presumptuous in the introduction:

This book is for you if you have tried to learn Mata by reading the Mata Reference Manual and failed. You are not alone. Though the manual describes the parts of Mata, it never gets around to telling you what Mata is, what is special about Mata, what you might do with Mata, or even how Mata’s parts fit together. This book does that.

I’m excited about the book, but for a while I despaired of ever completing it. I started and stopped four times. I stopped because the drafts were boring. Read more…

Importing Facebook data into Stata

As of 2018, this command no longer works due to Facebook API restrictions.

In a previous post, we released a new command to import Twitter data into Stata. We have now added another new command, facebook2stata, that imports Facebook data. To install facebook2stata, type

net install https://www.stata.com/users/kcrow/facebook2stata, replace

Read more…

Categories: Data Management Tags: ,

Importing data with import fred

Introduction

The Federal Reserve Economic Database (FRED), maintained by the Federal Reserve Bank of St. Louis, makes available hundreds of thousands of time-series measuring economic and social outcomes. The new Stata 15 command import fred imports data from this repository.

In this post, I show how to use import fred to import data from FRED. I also discuss some of the metadata that import fred provides that can be useful in data management. I then demonstrate how to use an advanced feature: importing multiple revisions of series whose observations are updated over time. Read more…

Categories: Data Management Tags: ,