0
votes

I have panel data with different dates and object names.

I want to create panel var in Stata (function pvar), but I need to "tsset variables"

sort object date
by object: gen t = _n
encode object , gen(icode)
xtset icode t

I get this error message

t ambiguous abbreviation
1
pvar and xtset are commands not functions. - Nick Cox

1 Answers

0
votes

I can't reproduce this problem. Consider this

. webuse grunfeld

. xtset
       panel variable:  company (strongly balanced)
        time variable:  year, 1935 to 1954
                delta:  1 year

. gen t = time

. xtset company t
       panel variable:  company (strongly balanced)
        time variable:  t, 1 to 20
                delta:  1 unit

Here t would be an ambiguous abbreviation for time, but Stata's rules imply that it chooses t, so the ambiguity doesn't bite.

In your case, I would ask for the results of

describe t*