Stata 15 help for obs

[D] obs -- Increase the number of observations in a dataset

Syntax

set obs #

Description

set obs changes the number of observations in the current dataset. # must be at least as large as the current number of observations. If there are variables in memory, the values of all new observations are set to missing.

Examples

. drop _all (drop data from memory) . set obs 100 (make 100 observations) . gen x = _n (x = 1, 2, 3, .., 100) . gen y = x^2 (y = 1, 4, 9, .., 10000) . scatter y x (make a graph)


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index