Are X1 and X2 both numeric? You might want to get them on equivalent scales, and also play around with the smoothing parameter.
Try something like: fit <- locfit(Y ~ lp(X1, X2, nn=___, scale=TRUE), family="binomial") and see what happens for different values of nn (try values between 0 and 1 and then some larger than one). I can't be much more help without data. On Jul 27, 2009, at 9:41 PM, cindy Guo wrote: > Hi, Ryan, > > Thank you for the information. I tried it. But there are some error > messages. > > When I use fit <- locfit(Y~X1*X2,family='binomial'), the error > message is > error lfproc(x, y, weights = weights, cens = cens, base = base, geth > = geth, : > compparcomp: parameters out of bounds > > And when I use fit <- locfit(Y~X1*X2), the error message is > error lfproc(x, y, weights = weights, cens = cens, base = base, geth > = geth, : > newsplit: out of vertex space > > This happens sometimes, not every time for different data. Do you > know what's the reason? > > Thank you, > > Cindy > > On Mon, Jul 27, 2009 at 5:25 PM, Ryan <rha...@purdue.edu> wrote: > > > > > > Hi, All, > > > > > > I have a dataset with binary response ( 0 and 1) and some > numerical > > > covariates. I know I can use logistic regression to fit the > data. But I > > > want > > > to consider more locally. So I am wondering how can I fit the > data with > > > 'loess' function in R? And what will be the response: 0/1 or the > > > probability > > > in either group like in logistic regression? > > > > > > -- Neither. Loess is an algorithm that smoothly "interpolates" > the data. It > > > makes no claim of modeling the probability for a binary response > variable. > > > > > > -- Bert Gunter > > > Genentech Nonclinical Statistics > > > > > > Thank you, > > > Cindy > > > > > > [[alternative HTML version deleted]] > > > > > Actually, loess is much more than an "interpolant". I wouldn't > even call it that. It is a local regression technique that comes > with all the equipment you get in classical regression. But it > is meant for normal-like errors, which is not what you have. > > I would recommend that you take a look at the locfit package. > It fits local likelihood models. I've never tried it with binary > data, > but if y is your 0/1 response and x is a covariate, you might try > something like: > > locfit(y ~ x, ..., family="binomial") > > If you have a good library at your disposal, try picking up Loader's > book "Local Regression and Likelihood". > > ______________________________________________ > 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. > [[alternative HTML version deleted]] ______________________________________________ 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.