SAS TVEM Macro for Estimating a Time-Varying Effect Model



(Available free to members. Register.)


SAS TVEM Macro Suite:




Users' Guide:



Data for TVEM Users' Guide Examples


%TVEM SAS Macro Suite Users' Guide (Version 2.1)


How to run a SAS macro

4-minute video: How to run a SAS macro


For use with SAS Version 9.x.


The TVEM SAS macro estimates coefficients in a time-varying effect model. Traditional analytic methods assume that covariates have constant (i.e., time-invariant) effects on a time-varying outcome. The %TVEM macros are able to estimate the time-varying effects of covariates. The %TVEM macro suite includes convenient tools for the analysis of intensive longitudinal data.


The %TVEM Macro Suite includes

  • TVEM (time-varying effect model) SAS macro suite%TVEM_normal for normally distributed outcomes
  • %TVEM_logistic for logistic-distributed outcomes
  • %TVEM_poisson for Poisson-distributed outcomes
  • %TVEM_zip for outcomes with zero-inflated Poisson models, and
  • %GLIMMIX for generalized mixed effects models1.


Features of all TVEM SAS macros include

  • ability to handle complicated models
  • generation of plots for estimated coefficient functions
  • parameter estimates saved to SAS data file
  • ability to specify covariates that have constant effects or time-varying effects, and
  • accommodation different distributions (normal, logistic, Poisson, or zero-inflated Poisson) outcomes measured over time.
  • Option to plot odds ratios and 95% confidence bands for logistic distributions - New in version 2.1
  • Substantial revision of the plots produced by the macros - New in version 2.1



Recommended Citations

TVEM SAS Macro Suite (Version 2.1.0) [Software]. (2012). University Park: The Methodology Center, Penn State. Retrieved from

Yang, J., Tan, X., Li, R., & Wagner, A. (2012). TVEM (time-varying effect model) SAS macro suite users' guide (Version 2.1.0). University Park: The Methodology Center, Penn State. Retrieved from



1This macro was developed by SAS Institute Inc. It is automatically called by the %TVEM macros when needed.

Need Help?

If you have questions or comments about the macro, please email


If your organization does not permit download and installation of files, please contact us with a shipping address and we will provide a CD containing all downloadable files.

Follow Us