I'm using a loop to create a unique pdf report for each member in list var and need to display the N and response rate for that member in the report.
I have defined the local value, which seems to run fine:
foreach section of local sections {
local clean = strtoname("`section'")
count
local responses = r(N)
local response_rate = round((`responses' / `enrolled_val') * 100, 0.1)
However when I try to display it in the report using put pdf text I get a type mismatch error, when I use the
putpdf text("Response Count: `responses'")
putpdf text("Response Rate: `response_rate'")
When I try to use
putpdf text("Response Count: `r(N)'")
I get the same.
How can I display the numeric value of r(N)?
Thank you!
I have defined the local value, which seems to run fine:
foreach section of local sections {
local clean = strtoname("`section'")
count
local responses = r(N)
local response_rate = round((`responses' / `enrolled_val') * 100, 0.1)
However when I try to display it in the report using put pdf text I get a type mismatch error, when I use the
putpdf text("Response Count: `responses'")
putpdf text("Response Rate: `response_rate'")
When I try to use
putpdf text("Response Count: `r(N)'")
I get the same.
How can I display the numeric value of r(N)?
Thank you!
Comment