What is the SAS Coding for a Paired T-test and boxplot of the following dataset on cars owned before and after winning the lottery?
Before: 1, 2, 2, 1
After: 3, 3, 4, 2
I dont have SAS so could not run it. If any bug please let me know,
Below is the code you can execute in SAS,
1) PAIRED t-test
Data Cars;
Input cars_before cars_after;
Datalines;
1 3
2 3
2 4
1 2;
run;
Proc TTEST;
Paired cars_before cars_after;
paired_t_test_cars;
run;
2) Box Plot of the data
Data Cars_1;
Input Sr_No cars_before;
Datalines;
1 1
2 2
3 2
4 1;
run;
PROC SGPLOT data = Cars_1;
Sr_No
cars_before / category = type;
Title "Cars Before BoxPlot";
Run;
Data Cars_2;
Input Sr_No cars_after;
Datalines;
1 3
2 3
3 4
4 2;
run;
PROC SGPLOT data = Cars_2;
Sr_No
cars_after / category = type;
Title "Cars After BoxPlot";
Run;
Get Answers For Free
Most questions answered within 1 hours.