/* ratcortex-ALL.sas */ /* rat cortex example: paired data one sample t inference */ /* data and analysis for all 5 runs of the experiment */ data rat; input experiment stimulated notstimulated; difference = stimulated-notstimulated; cards; 1 689 657 1 656 623 1 668 652 1 660 654 1 679 658 1 663 646 1 664 600 1 647 640 1 694 605 1 633 635 1 653 642 2 707 669 2 740 650 2 745 651 2 652 627 2 649 656 2 676 642 2 699 698 2 696 648 2 712 676 2 708 657 2 749 692 2 690 621 3 690 668 3 701 667 3 685 647 3 751 693 3 647 635 3 647 644 3 720 665 3 718 689 3 718 642 3 696 673 3 658 675 3 680 641 4 700 662 4 718 705 4 679 656 4 742 652 4 728 578 4 677 678 4 696 670 4 711 647 4 670 632 4 651 661 4 711 670 4 710 694 5 640 641 5 655 589 5 624 603 5 682 642 5 687 612 5 653 603 5 653 593 5 660 672 5 668 612 5 679 678 5 638 593 5 649 602 ; /* print the data */ proc print data=rat; var experiment stimulated notstimulated difference; title 'rat cortex data: all 5 experiments'; /* experiment 1 */ data rat1; set rat; if experiment=1; /* get confidence interval and test */ proc ttest data=rat1 ci=none plots (shownull only) = (histogram boxplot qq); paired stimulated*notstimulated; title 'rat cortex example experiment 1'; /* summarize and check for normality */ proc univariate data=rat1 normal nextrval=5; var difference; ods select BasicMeasures TestsForNormality ExtremeValues Quantiles; /* experiment 2 */ data rat2; set rat; if experiment=2; /* get confidence interval and test */ proc ttest data=rat2 ci=none plots (shownull only) = (histogram boxplot qq); paired stimulated*notstimulated; title 'rat cortex example experiment 2'; /* summarize and check for normality */ proc univariate data=rat2 normal nextrval=5; var difference; ods select BasicMeasures TestsForNormality ExtremeValues Quantiles; /* experiment 3 */ data rat3; set rat; if experiment=3; /* get confidence interval and test */ proc ttest data=rat3 ci=none plots (shownull only) = (histogram boxplot qq); paired stimulated*notstimulated; title 'rat cortex example experiment 3'; /* summarize and check for normality */ proc univariate data=rat3 normal nextrval=5; var difference; ods select BasicMeasures TestsForNormality ExtremeValues Quantiles; run; /* experiment 4 */ data rat4; set rat; if experiment=4; /* get confidence interval and test */ proc ttest data=rat4 ci=none plots (shownull only) = (histogram boxplot qq); paired stimulated*notstimulated; title 'rat cortex example experiment 4'; /* summarize and check for normality */ proc univariate data=rat4 normal nextrval=5; var difference; ods select BasicMeasures TestsForNormality ExtremeValues Quantiles; /* experiment 5 */ data rat5; set rat; if experiment=5; /* get confidence interval and test */ proc ttest data=rat5 ci=none plots (shownull only) = (histogram boxplot qq); paired stimulated*notstimulated; title 'rat cortex example experiment 5'; /* summarize and check for normality */ proc univariate data=rat5 normal nextrval=5; var difference; ods select BasicMeasures TestsForNormality ExtremeValues Quantiles; run;