[R] oversampling code

Kevin E. Thorpe kevin.thorpe at utoronto.ca
Tue Nov 1 17:59:14 CET 2011

On 11/01/2011 12:32 PM, loubna181 wrote:
> Hi,
> Thanks all for your responses, but as I m a new user of R while trying to
> apply what David suggests I dont know what *"dorm" *refers to.
> dfrm[c(rownames(dfrm[*dorm*$Y==1,]), sample(rownames(dfrm[dfrm$Y==0]),
> 0.10)) , ]

I suspect that dorm was a typo and that dfrm is what was meant.

> But to give you more details , I'm working on a table calles balance from
> UCI machine learning
> I do have a variable called class and takes 3 values : B, L and R.
> B represents 8% of the total and L and R 46% each one.
> The purpose is to have a data set with 10% of B, 40% of L and 40% of R.
> Thank u
> --
> View this message in context: http://r.789695.n4.nabble.com/oversampling-code-tp3956664p3964240.html
> Sent from the R help mailing list archive at Nabble.com.
> ______________________________________________
> R-help at 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.

Kevin E. Thorpe
Biostatistician/Trialist,  Applied Health Research Centre (AHRC)
Li Ka Shing Knowledge Institute of St. Michael's
Assistant Professor, Dalla Lana School of Public Health
University of Toronto
email: kevin.thorpe at utoronto.ca  Tel: 416.864.5776  Fax: 416.864.3016

More information about the R-help mailing list