Alias variables across frames

Since Stata 17, Stata has supported multiple datasets in memory. Each dataset resides in a frame. When datasets are related, you can link their frames by using the frlink command and identifying the variables that match the observations in the current frame with observations in the related frame. 

In Stata 18, you can use the new fralias add command to create alias variables across linked frames and easily perform analyses using variables stored in separate frames. 

Alias variables behave as if you copied them from one frame into another, but because they are stored in the original frame, they take up very litle memory. 

To see how easy alias variables are to use, say that y is a variable in the current frame and that x is a variable from a linked frame named frame2. To create an alias to x in the current frame, you type 

. fralias add x, from(frame2) 

Then you can fit a regression by typing 

. regress y x 

just as if x were stored in the current frame. 

Post your comment

Timberlake Consultants