Skip to content

xteventtest, trend( ) clashing after using savek( ) or kvars ( ) nogen #232

@jorpppp

Description

@jorpppp

Consider this workflow using savek (using the version with #230 fixed as in #231)

use example31,dta
xtevent y eta , panelvar(i) timevar(t) policyvar(z) window(5) reghdfe impute(nuchange) savek(dummies)
xteventtest, trend(-2)

returns this error:

You specified to save the event-time dummy variables using the prefix dummies, but you already have event-time dummy variables saved with that prefix.

Use the replace suboption to replace the existing variables.
r(198);

This happens because the internal call that xteventtest makes to _eventols uses the original command-line call with the savek( ) option, even though it should ignore it. After all, the k variables were already created.

Also consider trend testing after using xtevent, kvars( ) nogen

xtevent y eta , panelvar(i) timevar(t) policyvar(z) window(5) reghdfe impute(nuchange) kvars(dummies) nogen
xteventtest, trend(-2)

returns this error:

Estimating trend by OLS
variable _ttrend not found
r(198);

This happens because with kvars( ) nogen, _eventols skips _eventgenvars alltogether, even though it should call it to generate the trend.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions