- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hello.
I have not analyzed a continuous outcome for 5+ years. my work typically consists of analysis using logistic regression and cox regression.
Can you kindly help me out with the SAS code and interpretation for linear regression, pearson correlation and t-tests? I am analyzing the association between a group (4 levels) and an outcome (continuous). Please assume the outcome is continuously distributed.
Data Options:
1) attached SAS dataset
2) data step (below)
Variables:
- ID: unique key
- SAMPLE_GROUP: grouping variable. values: 1,2,3,4
- SAMPLE_GROUP2, SAMPLE_GROUP3, SAMPLE_GROUP4: dummy groups variables
- Q6_SLEEP_LINEAR: continuous outcome 1 (values: 0-100)
Many many thanks!!!!!
data questionnaire;
input id sample_group $1. sample_group2 sample_group3 sample_group4 q6_sleep_linear;
datalines;
11 4 0 0 1 25
12 4 0 0 1 0
13 1 0 0 0 50
14 4 0 0 1 25
15 1 0 0 0 75
16 4 0 0 1 25
17 3 0 1 0 75
18 2 1 0 0 50
19 3 0 1 0 75
20 4 0 0 1 100
21 1 0 0 0 75
22 2 1 0 0 50
23 3 0 1 0 50
24 4 0 0 1 25
25 1 0 0 0 0
26 2 1 0 0 75
27 2 1 0 0 0
28 4 0 0 1 25
29 4 0 0 1 100
30 2 1 0 0 0
31 2 1 0 0 100
32 2 1 0 0 25
33 1 0 0 0 50
34 3 0 1 0 75
35 4 0 0 1 25
;
run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
First, just so you know, I never download attachments, and so I can't view your data. The proper way to provide data is as working SAS data step code, which you can type in yourself or follow these instructions.
Your problem is easily handled by PROC GLM, in which case dummy variables are not needed. Technically, its an Analysis of Variance, not a regression, although you could argue that those are really the same thing. The idea of a Pearson correlation for categorical variables doesn't hold water. This code should produce the correct analysis and t-tests of the means.
proc glm data=questionnaire;
class sample_group;
model q6_sleep_linear=sample_group;
means sample_group/t;
run;
quit;
Paige Miller
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I added the SAS data step code to the post.
Warm regards.