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
Absent confidence intervals when using twoway lfitciHello, I'm generating some graphs for data illustration purposes. As a brief background, the projec…
How do I check goodness of fit when using "xtmlogit"?Hello, I'm trying to use "xtmlogit", a newly introduced command in stata17. How do I check the goodn…
Replacing string values with numerical valuesHi everyone, I'm working on a project using multiple tennis data sets (initially csv files, using a…
Predicting values using Simple Linear Regression on Categorical DataHi everyone, I have student scores for two test components (Component1 & Component2) from 485 s…
How to remove last 3 digits from a numerical variable in STATAHello Everyone! I have a variable HHPBASE, from which I need to chop off last 3 digits, How do I do …
Subscribe to:
Post Comments (Atom)
0 Response to Putpdf text printing unrounded numbers from a rounded variable
Post a Comment