# Line graph

#### Marvin85

##### Member
I have a health insurance variables: do you have health insurance? (yes/no). I have a year variables and a "type of state" variable (3 categories: expanding health insurance policy, not expanding, and debate). I would like a chart of the proportion people that have health insurance by year but also by type of state. So:
2010
expanding 30% health insurance
not explaining 32% health insurance
debate 15% health insurance

so on.

bysort year ACA: tab healthinsurance5

Can anyone help me. Please let me know if you would like the actual data set.

Thank you,
Marvin

#### bukharin

##### RoboStataRaptor
I would do this as:
Code:
tab type, gen(type_)
preserve
collapse (mean) type_*, by(year)
line type_* year
restore

#### Marvin85

##### Member
I notice that in you didn't use the variable health insurance. Now I am trying to have the mean age across years by State type.

year=2004
type1
50 years
type2
53
type3
40

year 2005
type1 40 years
type2 60

so on....

How can I do this? Can you briefly explain the logic of your commands so I can figure how to do this by my own.

Thank you,
MArvin