Question

In: Math

How to make a declie plot by using SAS?  

How to make a declie plot by using SAS?  

Solutions

Expert Solution

call to PROC LOGISTIC fits a linear model to these simulated data. That is, the model is intentionally misspecified. A call to PROC RANK creates a new variable (Decile) that identifies the deciles of the predicted probabilities for the model. This variable is used to compute the means of the predicted probabilities and the empirical proportions (and 95% confidence intervals) for each decile

/* Use PROC LOGISTIC and output the predicted probabilities.
   Intentionally MISSPECIFY the model as linear. */
proc logistic data=LogiSim noprint;
   model Y(event='1') = x;
   output out=LogiOut predicted=PredProb; /* save predicted probabilities in data set */
run;
 
/* To construct the decile calibration plot, identify deciles of the predicted prob. */
proc rank data=LogiOut out=LogiDecile groups=10;
   var PredProb;
   ranks Decile;
run;
 
/* Then compute the mean predicted prob and the empirical proportions (and CI) for each decile */
proc means data=LogiDecile noprint;
   class Decile;
   types Decile;
   var y PredProb;
   output out=LogiDecileOut mean=yMean PredProbMean
          lclm=yLower uclm=yUpper;
run;
 
title "Calibration Plot for Misspecified Model";
title2 "True Model Is Quadratic; Fit Is Linear";
proc sgplot data=LogiDecileOut noautolegend aspect=1;
   lineparm x=0 y=0 slope=1 / lineattrs=(color=grey pattern=dash);
   *loess x=PredProbMean y=yMean;  /* if you want a smoother based on deciles */
   series x=PredProbMean y=yMean;  /* if you to connect the deciles */
   scatter x=PredProbMean y=yMean / yerrorlower=yLower yerrorupper=yUpper;
   yaxis label="Observed Probability of Outcome";
   xaxis label="Predicted Probability of Outcome";
run;

Related Solutions

In statistics, how do you test independence using SAS programming?
In statistics, how do you test independence using SAS programming?
Using SAS is preferred but not required. Please provide SAS code and the relevant output if...
Using SAS is preferred but not required. Please provide SAS code and the relevant output if SAS is used. •             Link to referenced FEV.CSV: https://drive.google.com/open?id=1t1CRIbnTE7xL_OE9Bmajb564RXcg8nDo For all hypothesis testing problems: •             state the null and alternative hypotheses, •             calculate the value of the test statistic, •             determine if the results are statistically significant (using rejection region or p-value approaches), •             then state your conclusion in terms of the problem. 1.            FEV (forced expiratory volume) is an index of pulmonary function...
make a plot of the data in the table below , plot position versus time time...
make a plot of the data in the table below , plot position versus time time squared (t2 ). make sure to label your graph properly.( Y axis title with units, X axis title with unit, title of the graph with equation , major tick marks. use data to plot the graph manually. use proper scal measurement position(m) time(s) time2 (s2 ) 1 0 0 0 2 5 1 1 3 21 2 4 4 46 3 9 5 82...
How to solve this USING SAS EG? THANKS Automobile collisions: The number of collision claims (COLLISION)...
How to solve this USING SAS EG? THANKS Automobile collisions: The number of collision claims (COLLISION) reported for 1984-1986 cars are listed for 9 car categories: small two-door, midsized two-door, large two-door, small four-door, midsized four-door, large four-door, small station wagons and vans, midsized station wagons and vans, large station wagons and vans.. a. In excel convert the data to the format which is appropriate for SAS EG (the data should have 2 columns with names CARCLAS and CRASH). b....
Plot the original data and the regression “line” ************USING Matlab************. "Submit plot" USING MATLAB! USING MATLAB!...
Plot the original data and the regression “line” ************USING Matlab************. "Submit plot" USING MATLAB! USING MATLAB! USING MATLAB! ONLY BY USING MATLAB!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 14.9 The concentration of E. coli bacteria in a swimming area is monitored after a storm: t (hr)                     4           8         12        16    20 24 c (CFU/100 mL) 1600     1320   1000     890 650 560 The time is measured in hours following the end of the storm and the unit CFU is a .colony forming unit.. Use this data to estimate (a)...
using a box plot how can you determine if there are potential outliers?
using a box plot how can you determine if there are potential outliers?
So the problem is to create a plot of points and plot them using only 'o'...
So the problem is to create a plot of points and plot them using only 'o' and no lines then using the polyfit and polyval functions, find a first order equation to curve fit the points (and plot it on the existing plot). I got that part and have the following code clear clc %define measured data temp = [250 300 340 400 460 500 540 600 660 700 750 810 930 1000 1120] HC= [.791 .846 .895 .939 .978...
Using SAS programming Please include the syntax and output of the information: In a study of...
Using SAS programming Please include the syntax and output of the information: In a study of factors thought to be responsible for the adverse effects of smoking on human reproduction, cadmium level determinations (nanograms per gram) were made on placenta tissue of a sample of 14 mothers who were smokers and an independent random sample of 18 nonsmoking mothers. The results were as follows- Nonsmokers: 10.0, 8.4, 12.8, 25.0, 11.8, 9.8, 12.5, 15.4, 23.5, 9.4, 25.1, 19.5, 25.5, 9.8, 7.5,...
Using SAS programming Please include the syntax and output of the information: In a study of...
Using SAS programming Please include the syntax and output of the information: In a study of factors thought to be responsible for the adverse effects of smoking on human reproduction, cadmium level determinations (nanograms per gram) were made on placenta tissue of a sample of 14 mothers who were smokers and an independent random sample of 18 nonsmoking mothers. The results were as follows- Nonsmokers: 10.0, 8.4, 12.8, 25.0, 11.8, 9.8, 12.5, 15.4, 23.5, 9.4, 25.1, 19.5, 25.5, 9.8, 7.5,...
Using this SAS code for the data. The outcome variable is SBP and should be coded...
Using this SAS code for the data. The outcome variable is SBP and should be coded to appear on the y-axis. Note: you have to write the appropriate program Answer the following questions: Report the correlation coefficient and the p-value. (2pts) Report the parameter estimate for the intercept and heart rate (4pts) Using the regression equation, what is the expected blood pressure for someone with a heart rate of 153? (4pts) data sas_test; input hr sbp; datalines; 35 80 50...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT