Model with discrete variables like step function

#1
I have some data and I want to use a model such as linear regression to describe the relationship between y and x.

2001 2002 2003 2004 2005 2006 2007
y: 0.1 0.4 0.2 0.5 0.8 0.9 0.2
x1: 0.4 0.4 0.4 0.4 0.5 0.5 0.5
x2: 0 0 0 0 0 1 1
x3: 0.1 0.2 0.7 0.3 0.2 0.5 0.3

the data is just like the example above. I feel difficult to deal with x1 and x2, because it is just like a step function, it seems not suitable to deal with a linear regression, but I really need to describe the affection of x1, x2 on y.
Anybody have an idea that I could try?
 

rogojel

TS Contributor
#2
hi,
it looks like x1 and x2 were really discrete variables, maybe you could model them as such? ayou could define two indicator variables, one for x1 and one for x2 and run the regression with these.

regards
rogojel