Stata Contract

-contract- creates a dataset of descriptive statistics.

See here for other similar commands.


Usage

Given a dataset like:

id

foo

bar

baz

1

0

0

10

2

1

0

20

3

0

0

10

4

1

0

20

5

0

1

10

6

1

1

20

7

0

1

10

8

1

1

20

Running contract foo bar would create a dataset like:

foo

bar

_freq

0

0

2

0

1

2

1

0

2

1

1

2

To rename the frequency variable, try the freq(varname) option.


Statistics

-contract- can compute additional descriptive statistics using these option:


See also

Stata manual for -contract-


CategoryRicottone

Stata/Contract (last edited 2025-10-24 16:56:41 by DominicRicottone)