# # Written by: # -- # John L. Weatherwax 2007-07-05 # # email: wax@alum.mit.edu # # Please send comments and especially bug reports to the # above email address. # #----- gen_eq_10_2_data = function(N=100,p=10){ X = matrix( rnorm( N*p ), nrow=N, ncol=p ) Y = matrix( -1, nrow=N, ncol=1 ) threshold = qchisq(0.5,df=p) indx = rowSums( X^2 ) > threshold Y[indx] = +1 data.frame(X,Y) }