segue
Your SAS analyses, written in R.
Each page here takes a SAS step you already know, shows the R code that does the same job with the segue package, and reports how closely the results agree. Every comparison is checked by running both programs on thousands of inputs.
proc freq data=trial;
tables response
/ binomial(p=0.25 level="yes");
exact binomial;
weight count;
run;
library(segue)
bin_prop_test(
response,
method = "exact_sas",
null_value = 0.25
)Comparisons
-
Rounding numbers
Why
round()in R gives different answers thanROUND()in SAS, and how to get the SAS results in R.ROUND(x, 0.01) put x 8.2; sas_round(x, 2) sas_format(x, 2)
99.95% of 57,944 ROUND() results identical
-
Testing Single Binomial Proportions
bin_prop_test()is an interface to a set of statistial methods to test that \(H_0: \pi = \pi_0\) where \(\pi_0\) is the null value. There is a section below that descibes… -
Testing Numeric Data Using Rank-Based Statistics
numeric_rank_test()is an interface to a set of statistical methods to test whether the distribution of a numeric outcome differs between groups.
Comparison methodology
Run SAS on many inputs
A SAS program runs the analysis on a grid of inputs and edge cases, and saves the results as .sas7bdat files.
Run R on the same values
R reads those files bit for bit with haven, so both programs start from identical numbers.
Compare every result
Each page reports how many results are identical, the largest difference, and the reason for any gap.