*****Below is the SAS Code for the following question****** LIBNAME coh611 \"/co
ID: 3867053 • Letter: #
Question
*****Below is the SAS Code for the following question******
LIBNAME coh611 "/courses/dd4f9595ba27fe300" ACCESS=READONLY;
Data example;
Set coh611.ntdb;
If disposition in (‘Died’) then dead = 1;
Else dead = 0;
If sbp1 = . then hypotensive = .;
Else if sbp1 <90 then hypotensive = 1;
Else hypotensive = 0;
If age = . Then youth = .;
Else if age <9 then youth =1;
Else youth = 0;
Run;
ASSIGNMENT #4
In this assignment, you will use a sample of the National Trauma Data Bank,
the dataset is in the course directory with the name NTDB.
Up to this point you have just copied and run the statements. In this
assignment you will be writing some simple code of your own.
Part A: Exploring your data (1 point)
(Review assignment 1 if you don't remember how to write the SAS code to do this.)
1. Print the contents of the dataset.
Part B: Data Management (2 points)
We are now going to create a dummy variable to indicate whether or not people have died. People who have died will have a disposition as (‘Died’) but it would be more helpful if it was coded as a 1 and everyone else a 0.
We'd also like to determine if patients are hypotensive (sbp < 90) by creating a dummy variable; hypotensive patients coded as a 1 and everyone else a 0.
LIBNAME COH611 “/courses/dd4f9595ba27fe300” ACCESS=READONLY;
The following statements show how to fix the data for these two variables.
Data example;
Set coh611.ntdb;
If disposition in (‘Died’) then dead = 1;
Else dead = 0;
If sbp1 = . then hypotensive = .;
Else if sbp1 <90 then hypotensive = 1;
Else hypotensive = 0;
Run;
Add statements to do the following:
Create a variable named youth that is set to 1 if age (AGE) is less than 9 and 0 otherwise . (HINT: Look in the output of your contents procedure to determine which this is.
HINT: To run a chi square test use this format:
PROC FREQ DATA = example;
TABLES variable1*variable2 / CHISQ CMH;
run;
HINT: To run a correlation test, use this format:
proc corr data = example;
var variable1 variable2;
run;
For the slope model code, please review CLP from July 31.
Part C: Data Analysis (3 points)
Test for a relationship between hypotension and death using a Chi-square test
What is the odds ratio? What is the p-value?
Test for a relationship between sbp1 and pulse1 using a correlation
What is the correlation coefficient? What is the slope model?
Test for the relationship between youth (the variable you created) and death using a Chi-square test
What is the odds ratio? What is the p-value?
Part D: Conclusion (4 points)
Discuss the results from the three tests conducted in Part C. Did you find a relationship or not? What statistics support the relationship (or lack thereof)?
Explanation / Answer
Hi,
You forgot to attach dataset and it is needed to proceed further but I will try to answer your questions without dataset.
1. Print the contents of the dataset.
Create a variable named youth that is set to 1 if age (AGE) is less than 9 and 0 otherwise
Answer:
Data example;
Set coh611.ntdb;
If disposition in (‘Died’) then dead = 1;
Else dead = 0;
If sbp1 = . then hypotensive = .;
Else if sbp1 <90 then hypotensive = 1;
Else hypotensive = 0;
Else if age<9 then youth=1;
else youth=0;
Run;
3. What is the odds ratio? What is the p-value?
Answer:
Odds ratio
The odds ratio compares the odds of two events. The odds of an event are the probability that the event occurs divided by the probability that the event does not occur.
Interpretation
Use the odds ratio to understand the effect of a predictor. The interpretation of the odds ratio depends on whether the predictor is categorical or continuous.
Odds ratios for continuous predictors
Odds ratios that are greater than 1 indicate that the even is more likely to occur as the predictor increases. Odds ratios that are less than 1 indicate that the event is less likely to occur as the predictor increases.
In these results, the model uses the dosage level of a medicine to predict the presence or absence of bacteria in adults. The odds ratio indicates that for every 1 mg increase in the dosage level, the likelihood that no bacteria is present increases by approximately 38 times.
Odds Ratios for Continuous Predictor
Odds Ratio
95% CI
Dose (mg)
37.5511
(2.96, 475.65)
Odds ratios for categorical predictors
For categorical predictors, the odds ratio compares the odds of the event occurring at 2 different levels of the predictor. Minitab sets up the comparison by listing the levels in 2 columns, Level A and Level B. Odds ratios that are greater than 1 indicate that the event is more likely at level A. Odds ratios that are less than 1 indicate that the event is less likely at level A.
In these results, the response indicates whether a consumer bought a cereal and the categorical predictor indicates whether the consumer saw an advertisement about that cereal. The odds ratio is 3.06, which indicates that the odds that a consumer buys the cereal is 3 times higher for consumers who viewed the advertisement compared to consumers who didn't view the advertisement.
Odds Ratios for Categorical Predictor
Level A
Level B
Odds Ratio
90% CI
Yes
No
3.06566
(1.232, 7.630)
Odds ratio for level A relative to level B
Confidence interval for odds ratio (95% CI)
These confidence intervals (CI) are ranges of values that are likely to contain the true values of the odds ratios. The calculation of the confidence intervals uses the normal distribution. The confidence interval is accurate if the sample size is large enough that the distribution of the sample odds ratios follow a normal distribution.
Because samples are random, two samples from a population are unlikely to yield identical confidence intervals. However, if you take many random samples, a certain percentage of the resulting confidence intervals contain the unknown population parameter. The percentage of these confidence intervals that contain the parameter is the confidence level of the interval.
The confidence interval is composed of the following two parts:
Point estimate
This single value estimates a population parameter by using your sample data. The confidence interval is centered around the point estimate.
Margin of error
The margin of error defines the width of the confidence interval and is determined by the observed variability in the sample, the sample size, and the confidence level. To calculate the upper limit of the confidence interval, the margin of error is added to the point estimate. To calculate the lower limit of the confidence interval, the margin of error is subtracted from the point estimate.
Interpretation
Use the confidence interval to assess the estimate of the odds ratio.
For example, with a 95% confidence level, you can be 95% confident that the confidence interval contains the value of the odds ratio for the population. The confidence interval helps you assess the practical significance of your results. Use your specialized knowledge to determine whether the confidence interval includes values that have practical significance for your situation. If the interval is too wide to be useful, consider increasing your sample size.
4. What is correlation coefficient?
Correlation Coefficient
The correlation coefficient of two variables in a data set equals to their covariance divided by the product of their individual standard deviations. It is a normalized measurement of how the two are linearly related.
Formally, the sample correlation coefficient is defined by the following formula, where sx and sy are the sample standard deviations, and sxy is the sample covariance.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.