Hello,
I am using FRED data to create a pdf report of unemployment information. The goal is to have the pdf state "The current rate is X, which is more/less/the same as last year's average rate of Y." However, Y is printed with multiple decimal points even when I try using the round() function.
To create the rounded variable:
gen year = substr(date, 1, 4)
gen ryear = real(year)
egen yrave = sum((UNRATE)/12), by(ryear)
gen yrave_r = round(yrave, 0.1)
After doing that, when asking Stata to list yrave_r or using codebook and describe, it would seem that the values of yrave_r are rounded to the .1 decimal place. However, then I try printing the number in a pdf:
putpdf begin
putpdf paragraph
putpdf text (yrave_r[1])
and instead of producing the nice rounded number reported with list, the pdf will include many more decimal points beyond the tenths place (for example 3.9000001 instead of just 3.9). Can someone explain to me why this is and how I can fix it?
Related Posts with Putpdf text printing unrounded numbers from a rounded variable
Having trouble while using inequality signs.Hi. I am having trouble with following script. It is a real basic function but I don't know why it …
Describing missing data by country and variableCan use by with mdesc command, or can I somehow describe missing data by country and variable. …
r(3900); error running Latent Class AnalysisI'm trying to run a latent class analysis analysis (60,000 cases, 20 variables, with group (6 groups…
xtlogit, re gives constant with large magnitudeMy xtlogit, re regression gives constant estimate of 40.23.. (and is significant) while my model cov…
Graph Descriptive statistics.Hi Stata Users , I'm looking at the relationship between health outcomes of mother(Bmi. and hemoglo…
Subscribe to:
Post Comments (Atom)
0 Response to Putpdf text printing unrounded numbers from a rounded variable
Post a Comment