Hello!
I am trying to use the ptrend command to look at my binary y variable and categorical x variable (years 2013-2018).
My data set is burn admissions divided by the total number of hospital admissions for the year. I am looking at the trend of admissions over the 6 years.
The data that I want to use are the float variables, which have been created by division of the long and integer variables. When I run the ptrend command with the float data, the error r(2000) "no observations" appears.
I am able to use the ptrend command with integer and long data, but the integer is a raw count of admissions and I want to look at burn admissions as a percentage of total admissions.
My question: Does anyone have a recommendation for how I can use the ptrend command with this data?
I have attached my code below.
Thank you so much.
Best,
Cami Rencken
. describe
Contains data
obs: 6
vars: 17
size: 336
-------------------------------------------------------------------------------------------------------------------------------------------------------
storage display value
variable name type format label variable label
-------------------------------------------------------------------------------------------------------------------------------------------------------
year int %8.0g Year
admissionstotal long %8.0g Admissions - Total
severe int %8.0g
sad float %8.0g
scontrol float %8.0g
moderate int %8.0g
moad float %8.0g
mocontrol float %8.0g
mild int %8.0g
miad float %8.0g
micontrol float %8.0g
child int %8.0g
cad float %8.0g
ccontrol float %8.0g
adult int %8.0g
aad float %8.0g
acontrol float %8.0g
-------------------------------------------------------------------------------------------------------------------------------------------------------
Sorted by:
Note: Dataset has changed since last saved.
. ptrend sad scontrol year
no observations
r(2000);
. tab sad
sad | Freq. Percent Cum.
------------+-----------------------------------
.0005697 | 1 16.67 16.67
.0006279 | 1 16.67 33.33
.000639 | 1 16.67 50.00
.000644 | 1 16.67 66.67
.0006458 | 1 16.67 83.33
.0006893 | 1 16.67 100.00
------------+-----------------------------------
Total | 6 100.00
. tab scontrol
scontrol | Freq. Percent Cum.
------------+-----------------------------------
.000639 | 6 100.00 100.00
------------+-----------------------------------
Total | 6 100.00
Related Posts with Problem using ptrend command
Doubts about interpretation of the estimated coefficients using a stochastic frontier modelIn my thesis, I´m estiming a stochastic frontier model (SFM). The first equation estimates the produ…
Issue with histogram: Single outlier and x-axis scaleI have uploaded a .png of my experimental histogram. The code for it is as follows Code: histogr…
Partialing out multiple regressors (Frisch-Waugh Lovell Theorem) and reghdfe commandDear All, I want to run a generalized diff-in-diff regression that exploits time variation in state…
how can I generate a dummy variable based on another dummy variable?Hi all, my data pretty much looks like the following Code: Year company var1 1999 CompanyA 0 200…
Looping correlation between variablesHi, With following data: Code: * Example generated by -dataex-. To install: ssc install dataex cle…
Subscribe to:
Post Comments (Atom)
0 Response to Problem using ptrend command
Post a Comment