Archive

Archive for November 2020

Stata/Python integration part 9: Using the Stata Function Interface to copy data from Python to Stata

In my previous post, we learned how to use the Stata Function Interface (SFI) module to copy data from Stata to Python. In this post, I will show you how to use the SFI module to copy data from Python to Stata. We will be using the yfinance module to download financial data from the Yahoo! finance website. You can install this module in your Python environment by typing pip install yfinance. Our goal is to use Python to download historical data for the Dow Jones Industrial Average (DJIA) and use Stata to create the following graph. Read more…

Categories: Programming Tags: , ,

Stata for Mac with Apple Silicon

Update (14 January 2021): Stata’s Apple Silicon support has been fully tested on M1 Macs and is no longer in beta.

Update (23 November 2020): We stated earlier that nonuniversal versions of Stata/MP would not run on Macs with Apple Silicon. This was based on our experience with attempting to run a nonuniversal version of Stata/MP on an Apple developers kit that contained an A14 SOC (system on chip) instead of an M1 SOC. However, we have since obtained a production Mac Mini with an M1 SOC and have found that nonuniversal versions of Stata/MP will in fact run on Macs with Apple Silicon.

Apple has announced the first set of Macs that are transitioning to Apple Silicon. Apple claims that Macs with Apple Silicon promise better performance and longer battery life than the previous generations of Macs. This will be of great interest to our Stata-for-Mac users, many of whom use Mac laptops.

Read more…

Stata/Python integration part 8: Using the Stata Function Interface to copy data from Stata to Python

In my previous posts, I used the read_stata() method to read Stata datasets into pandas data frames. This works well when you want to read an entire Stata dataset into Python. But sometimes we wish to read a subset of the variables or observations, or both, from a Stata dataset into Python. In this post, I will introduce you to the Stata Function Interface (SFI) module and show you how to use it to read partial datasets into a pandas data frame. Read more…

Categories: Programming Tags: , ,