Hello everyone,
I am trying to create an interaction variable by multiplying a dummy variable (0,1) with a date variable. I am thinking that for all values of 0 multiplied by the date should be 0, while those multiplied by 1 should be the same as the date. I realize that once I format the interaction variable to a date variable, I get a date of 1960m1 for those multiplied by 0. I have included an example and would be grateful to know if there is a way to get 0 values for the interaction variables instead of the '1960m1' date.
Thank you.
[CODE]
* Example generated by -dataex-. To install: ssc install dataex
clear
input float(after_policy date date_after)
1 1993m6 1993m6
0 1991m2 1960m1
0 1992m8 1960m1
1 1993m7 1993m7
0 1991m7 1960m1
end
Related Posts with Interaction variable (using dummy and date variables)
Error using readreplace in Stata17 versionHi All, I'm now using the command: readreplace in Stata 17 version. I got the following error, pleas…
Calculating Systematic Coronary Risk Evaluation in stataHello, I am calculating the Systematic Coronary Risk Evaluation in Stata, described in this article…
Foreach code is not limiting to varlistHello, I am sorry if this is something simple I am missing, and thank you in advance for your thoug…
Using 'cgmwildboot' _ Standard errors "Null"Dear all, I need some help with running the 'cgmwildboot' command. I intend to utilize a Control Fun…
Creating super tables of proportions in STATAHi, I have 12 variables labeled treat1 - treat12. All the responses are coded as Y/N. I would like t…
Subscribe to:
Post Comments (Atom)
0 Response to Interaction variable (using dummy and date variables)
Post a Comment