- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I'm a new user to SAS, and I am trying to figure out how to run a two sample t-test by referencing data I had previously imported from two different excel files. I am using the most recent version of SAS studio (I installed SAS on my Virtual Box two weeks ago). When importing my excel files, I used this code:
PROC IMPORT OUT= WORK.auto
DATAFILE= "/folders/myfolders/auto.xls"
DBMS=XLS REPLACE;
GETNAMES=YES;
RUN;
I am aware that you can run two sample t-tests by using this kind of code:
DATA response;
INPUT group $ time;
DATALINES;
c 80
c 93
c 83
c 89
c 98
t 100
t 103
t 104
t 99
t 102
;
PROC UNIVARIATE DATA = response normal plot;
class group;
var time;
histogram time / midpoints = 80 to 120 by 5 normal;
RUN;
However, I am running t-tests on data sets with 1000+ entries, and I was wondering, is there any way that I can reference data in a column on the table I pulled in from the first block of code? Like, instead of copying and pasting in the data set from a column, is there some line of code I can use to just reference a certain column from the data? I would really appreciate it if you can post a sample code that would be able to do this.
Also, is there some manual on SAS that would teach me how to run code on t-tests, Z-scores, chi squares, etc?
Thanks!
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi. There's a pretty good chance I'm just not following, but maybe this will help:
1. For a t-test of two independent samples, use proc ttest.
2. Once you've imported your data, no pasting of data should necessary. If your IMPORT creates work.auto, then reference that datast on your subsequent proc ttest call, e.g.,:
proc import out=auto....;
....
...
run;
proc ttest data = auto....;
...
....
run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi. There's a pretty good chance I'm just not following, but maybe this will help:
1. For a t-test of two independent samples, use proc ttest.
2. Once you've imported your data, no pasting of data should necessary. If your IMPORT creates work.auto, then reference that datast on your subsequent proc ttest call, e.g.,:
proc import out=auto....;
....
...
run;
proc ttest data = auto....;
...
....
run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I'll try that out and see if it works!