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
Peer firm averageHi, I have a panel data (firm-year level). Anyone knows how to construct Peer firm average, which i…
How to refer to specific pairs of observations-variables using locals, ex: "`=price[make == "AMC Concord"]'"Dear all, I was trying to automate the creation of a two-sided bar graph and then realized that the…
Who do people rescale a weight variable?Dear all, I have a question on rescaling/transforming a variable, particularly a weight variable. I…
Generating week IDs based on fiscal yearsI am quite new to stata and struggling to generate weeks based on fiscal year start and end dates. S…
Data visualization - How to break a label on tline into multiple lines?Hello, Please see my current graph. I would like to split the "Arab Spring" label in two lines M…
Subscribe to:
Post Comments (Atom)
0 Response to Putpdf text printing unrounded numbers from a rounded variable
Post a Comment