Thanks yet again to Kit Baum, a new package lastupto is now available for download from SSC. In Stata, use the ssc command to do this.
The lastupto package is described as below on my website. I plan to use it mostly to condense Kaplan-Meier curves produced using sts generate before plotting them. If not condensed, Kaplan-Meier curves from big datasets can produce gigabyte-sized .svg files, which take minutes to become visible using a Web browser.
Best wishes
Roger
----------------------------------------------------------------------------------------
package lastupto from http://www.rogernewsonresources.org.uk/stata10
----------------------------------------------------------------------------------------
TITLE
lastupto: Condense a dataset to have 1 observation for each of a list of X-values
DESCRIPTION/AUTHOR(S)
lastupto inputs a dataset in memory with an X-variable, a list of
X-values, and (optionally) a list of by-variables. It creates an
output dataset (or resultsset}, with 1 observation per provided X-value
in the list (or per X-value per by-group), and data on the variable
values in the last observation in the dataset (or by-group) with an
X-value up to and including the provided X-value, when the observations
have been sorted by by-group, then by their X-values, and then by their
pre-existing order. lastupto is very useful for condensing
Kaplan-Meier curves in big datasets. lastupto uses the SSC package
expgen, which must be installed if lastupto is to work.
Author: Roger Newson
Distribution-Date: 22july2018
Stata-Version: 10
INSTALLATION FILES (click here to install)
lastupto.ado
lastupto.sthlp
----------------------------------------------------------------------------------------
(click here to return to the previous screen)
The lastupto package is described as below on my website. I plan to use it mostly to condense Kaplan-Meier curves produced using sts generate before plotting them. If not condensed, Kaplan-Meier curves from big datasets can produce gigabyte-sized .svg files, which take minutes to become visible using a Web browser.
Best wishes
Roger
----------------------------------------------------------------------------------------
package lastupto from http://www.rogernewsonresources.org.uk/stata10
----------------------------------------------------------------------------------------
TITLE
lastupto: Condense a dataset to have 1 observation for each of a list of X-values
DESCRIPTION/AUTHOR(S)
lastupto inputs a dataset in memory with an X-variable, a list of
X-values, and (optionally) a list of by-variables. It creates an
output dataset (or resultsset}, with 1 observation per provided X-value
in the list (or per X-value per by-group), and data on the variable
values in the last observation in the dataset (or by-group) with an
X-value up to and including the provided X-value, when the observations
have been sorted by by-group, then by their X-values, and then by their
pre-existing order. lastupto is very useful for condensing
Kaplan-Meier curves in big datasets. lastupto uses the SSC package
expgen, which must be installed if lastupto is to work.
Author: Roger Newson
Distribution-Date: 22july2018
Stata-Version: 10
INSTALLATION FILES (click here to install)
lastupto.ado
lastupto.sthlp
----------------------------------------------------------------------------------------
(click here to return to the previous screen)