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
Duplication of ID variables in panel dataHi All. I have the following duplication of data in id & p_id, which I need to resolve. This da…
Likelihood ratio omnibus test of significance & multiple comparisonsHi there, I have a data set which includes: 5 polygenic scores for different mental illnesses and a…
Keeping duplicate observations with the true value in other variablesHi Stata users, I have a problem looping over string values. I have a data set that contains duplic…
Interaction term insignificance & Marginsplot problemHi all, My initial pooled OLS estimation yields results with statistically significant coefficients…
CFA correlation error loading issueHi guys, What am i doing wrong ? I am working on CFA and I trying to correlate my error loading but…
Subscribe to:
Post Comments (Atom)
0 Response to Putpdf text printing unrounded numbers from a rounded variable
Post a Comment