Helene.Dryssens@eleves.polytech-lille.fr
2005-Feb-07 16:19 UTC
[R] problem with logistic regression
Hi, we try to do a logistic regression with the function glm. But we notice that this function don't give the same results as the SAS proc catmod (differents estimate given). We try to change the contrast on R system with:> options(contrasts=c(unordered="contr.SAS",ordered="contr.poly"))We also try with brlr and logistf functions. Unfortunately, the estimate aren't still the same. Please could someone help us. Thank you -------------------------------------------------- This mail sent through Polytech'Lille WebMail (IMP)
CATMOD in SAS builds log-linear glms. If you are truly trying to create logistic regressions in SAS, use PROC LOGISTIC instead. If you really meant that you are trying to create log-linear models in R - then look up the usage of the function loglin (e.g. loglin()) Cheers, Joe Quoting Helene.Dryssens at eleves.polytech-lille.fr:> Hi, > > we try to do a logistic regression with the function glm. > But we notice that this function don't give the same results as the SAS proc > catmod (differents estimate given). > We try to change the contrast on R system with: > > options(contrasts=c(unordered="contr.SAS",ordered="contr.poly")) > > We also try with brlr and logistf functions. > Unfortunately, the estimate aren't still the same. > > Please could someone help us. > > Thank you > > -------------------------------------------------- > This mail sent through Polytech'Lille WebMail (IMP) > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html >~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Joseph J. Nocera Ph.D. Candidate NB Coop. Fish & Wildlife Research Unit Biology Department - Univ. New Brunswick Fredericton, NB Canada E3B 6E1 tel: (902) 679-5733 "Why does it have to be spiders? Why can't it be 'follow the butterflies'"?! - Ron Weasley, Harry Potter & The Chamber of Secrets
Helene.Dryssens at eleves.polytech-lille.fr writes:> Hi, > > we try to do a logistic regression with the function glm. > But we notice that this function don't give the same results as the SAS proc > catmod (differents estimate given). > We try to change the contrast on R system with: > > options(contrasts=c(unordered="contr.SAS",ordered="contr.poly")) > > We also try with brlr and logistf functions. > Unfortunately, the estimate aren't still the same.contr.SAS is something of a contradiction in terms since SAS does not use the same type of contrast in all procedures. I believe PROC CATMOD is using sum contrasts (contr.sum), whereas contr.SAS gives you something similar to PROC GENMOD (last level set to zero). -- O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907
Helene, The problem is not with R, but with the specification of the SAS procedure you used. It would be simpler and more comparable if you specify your model in SAS with Proc Logistic or Proc Genmod. See if they work out for you, Tim ---- Original message ---->Date: Mon, 7 Feb 2005 17:19:54 +0100 >From: Helene.Dryssens at eleves.polytech-lille.fr >Subject: [R] problem with logistic regression >To: r-help at stat.math.ethz.ch >Cc: nathaliebouez at yahoo.fr > >Hi, > >we try to do a logistic regression with the function glm. >But we notice that this function don't give the same resultsas the SAS proc>catmod (differents estimate given). >We try to change the contrast on R system with: >>options(contrasts=c(unordered="contr.SAS",ordered="contr.poly"))> >We also try with brlr and logistf functions. >Unfortunately, the estimate aren't still the same. > >Please could someone help us. > >Thank you > >-------------------------------------------------- >This mail sent through Polytech'Lille WebMail (IMP) > >______________________________________________ >R-help at stat.math.ethz.ch mailing list >https://stat.ethz.ch/mailman/listinfo/r-help >PLEASE do read the posting guide!http://www.R-project.org/posting-guide.html