How to handle dummy variable with fraction as possible values

Hello ,
I am working on a data with a dummy variable values not just 0 or 1. It has fractions as values which denote the number of month within a year the a certain policy was in effect ; like 0.33 for 4 months and 0.5 for 6 months. This is the first time I am seeing this kind of dummy variable. I will appreciate any advise on how to proceed



Omega Contributor
Is it a dummy variable or are they trying to treat it as a continuous variable?

Why can't you just dummy code it into 11 binary variables?
Last edited:
It is a dummy. I will explain , somethin like a variable for the presence of gun control law in a state. In a panel data from 1990 to 2000; if the a gun control law was present throughout the year value is 1, if absent throughout the year value is 0 but if started let say by September 1 , it will be 0.25 ( 1/4th of the year) . if by July then value is 0.5( 1/2 of the year)



Ambassador to the humans
So once again... Doesn't sound like a dummy variable to me. It just sounds like a variable that measures the percent of the year that a criteria was or wasn't met. I'm not sure why you're tied to calling this a dummy variable (which has a specific meaning).

I'm not sure what your question is though.
The way I see it is you can keep it as is, and it has the interpretation that Dason mentioned just above, or you can make 11 dummy variables as hlsmith noted. X1= 1 if effective in January; 0 if not....X11= 1 if effective in November; 0 if not... December would be the base level in my example, but that's arbitrary and you might have a better reason for selecting one month as the base level in comparison to another.

The choice depends on whether or not you think the relationship is more smooth and the average is about the same for these groups, in which case you may opt to keep the current variable, again not a dummy variable. If you think the relationship needs to account for discrete changes in the means between groups, or maybe that slopes differ between the groups, then the dummy variable route may be more appropriate for you (need interaction if you want different slopes between groups).