> -----Original Message----- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] > On Behalf Of SASandRlearn > Sent: Monday, November 12, 2012 5:55 PM > To: r-help@r-project.org > Subject: [R] Proc Nnpar1way with D option - equivalent in R > > I am trying to match SAS output with R. > > I am using Proc Npar1way with D option to get KS test statistic. > • > Here X is a binary dependent variable and Y is the predicted > probabilities; > proc npar1way data = mydata D; class x; var y; run; > > When i try this in R > > > ks.test(x, fitted(y),alternative = c("two.sided"),exact = NULL) I get very > different result compared to SAS. > > I am new to R. Any help is appreciated. I think i am missing a datastep > maybe ? > > Thank you. > > >
To reproduce the SAS results in R, you need to specify the ks.test something like: ks.test(y[x==1], y[x==0],alternative = c("two.sided"),exact = NULL) I say something "like", because I don't know what the binary values for x are, so I just used 1 and 0. If this doesn't help, then you need to provide some data and your actual results so that you have an actual reproducible example (see the posting guide). Hope this is helpful, Dan Daniel Nordlund Bothell, WA USA ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.