Hi! I am trying to create a line graph, but I am not sure why the line trend has so many sharp ups and downs. While none of the y axis values are below three (absolutely no zeros), the graph shows like there are zeros in my dataset. I expected my graph looks something like the red line (I drew by hand to demonstrate), but am not sure what is causing this. Please see my graph and code below. Many thanks for your help in advance!
levelsof name, local(levels)
levelsof type, local(levels2)
local vars main_variable day_number
foreach o in `levels' {
foreach x in `levels2' {
line `vars' if name==`o' ///
, xlabel(2(4)82) ytitle("Visit (#)") xtitle("Day number") ///
title("`: lab (name) `o''" (`: lab (type) `x''))
}
}
levelsof name, local(levels)
levelsof type, local(levels2)
local vars main_variable day_number
foreach o in `levels' {
foreach x in `levels2' {
line `vars' if name==`o' ///
, xlabel(2(4)82) ytitle("Visit (#)") xtitle("Day number") ///
title("`: lab (name) `o''" (`: lab (type) `x''))
}
}
Comment