Hello I am running R 1.8.1 on a Windows platform I am attempting to fit an ordinal logistic regression model, using the polr function, as described in Venables and Ripley. But when I try model4 <- polr(ypsxcat~committed + as.factor(sex) + as.factor(drugusey) + anycsw + as.factor(sex)*committed + as.factor(sex)*as.factor(drugusey)+as.factor(sex)*anycsw, data duhray) I get a message that the polr function was not found. Any help appreciated thanks Peter Peter L. Flom, PhD Assistant Director, Statistics and Data Analysis Core Center for Drug Use and HIV Research National Development and Research Institutes 71 W. 23rd St www.peterflom.com New York, NY 10010 (212) 845-4485 (voice) (917) 438-0894 (fax)
help.search() is your friend: polr(MASS) Proportional Odds Logistic Regression HTH, Andy> From: Peter Flom > > Hello > > I am running R 1.8.1 on a Windows platform > > I am attempting to fit an ordinal logistic regression model, using the > polr function, as described in Venables and Ripley. But when I try > > model4 <- polr(ypsxcat~committed + as.factor(sex) > + as.factor(drugusey) + anycsw + as.factor(sex)*committed > + as.factor(sex)*as.factor(drugusey)+as.factor(sex)*anycsw, data > duhray) > > I get a message that the polr function was not found. > > Any help appreciated > > thanks > > Peter > > Peter L. Flom, PhD > Assistant Director, Statistics and Data Analysis Core > Center for Drug Use and HIV Research > National Development and Research Institutes > 71 W. 23rd St > www.peterflom.com > New York, NY 10010 > (212) 845-4485 (voice) > (917) 438-0894 (fax) > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.html > >------------------------------------------------------------------------------ Notice: This e-mail message, together with any attachments,...{{dropped}}
Peter, These things can be a little mysterious at the beginning. Lots of things in R are arranged in groups called packages (or libraries). Some basic ones come preinstalled with R, some you have to install yourself. If you type library() at your R prompt you should get a list of all packages installed on your system. In order to use the functionality of a package you have to load it by specifying its name as an argument to the library call. For example, library(nlme) will load the package named "nlme" (if it is installed on your system) and give you the functionality of the nlme package, i.e. access to its functions.. Typing search() will show you what packages are already loaded on your system. Search.help will allow you to find in which package your function resides in. Typing search.help(polr) on my system returns polr(MASS) Proportional Odds Logistic Regression meaning that the polr function belongs to the package MASS which is installed on your system. The only thing remaining to do is typing library(MASS) Of course, if MASS is not installed on your system you will get nothing in response (actually you will get a message saying that nothing appropriate was found). Then, you would need to go to a CRAN site and use their search engine to find things about polr function. Hope this helps, Andy __________________________________ Andy Jaworski 518-1-01 Process Laboratory 3M Corporate Research Laboratory ----- E-mail: apjaworski at mmm.com Tel: (651) 733-6092 Fax: (651) 736-3122 |---------+---------------------------------------------------> | | "Peter Flom" <flom at ndri.org> | | | Sent by: | | | r-help-bounces+apjaworski=mmm.com at stat.m| | | ath.ethz.ch | | | | | | | | | 03/03/2004 14:42 | | | | |---------+---------------------------------------------------> >-----------------------------------------------------------------------------------------------------------------------------| | | | To: <r-help at stat.math.ethz.ch> | | cc: | | Subject: [R] Location of polr function | >-----------------------------------------------------------------------------------------------------------------------------| Hello I am running R 1.8.1 on a Windows platform I am attempting to fit an ordinal logistic regression model, using the polr function, as described in Venables and Ripley. But when I try model4 <- polr(ypsxcat~committed + as.factor(sex) + as.factor(drugusey) + anycsw + as.factor(sex)*committed + as.factor(sex)*as.factor(drugusey)+as.factor(sex)*anycsw, data duhray) I get a message that the polr function was not found. Any help appreciated thanks Peter Peter L. Flom, PhD Assistant Director, Statistics and Data Analysis Core Center for Drug Use and HIV Research National Development and Research Institutes 71 W. 23rd St www.peterflom.com New York, NY 10010 (212) 845-4485 (voice) (917) 438-0894 (fax) ______________________________________________ R-help at stat.math.ethz.ch mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Peter Flom wrote:> I am running R 1.8.1 on a Windows platform > > I am attempting to fit an ordinal logistic regression model, using the > polr function, as described in Venables and Ripley. But when I try > > model4 <- polr(ypsxcat~committed + as.factor(sex) > + as.factor(drugusey) + anycsw + as.factor(sex)*committed > + as.factor(sex)*as.factor(drugusey)+as.factor(sex)*anycsw, data > duhray) > > I get a message that the polr function was not found.Load the MASS package prior to calling polr(). library(MASS) -- Chuck Cleland, Ph.D. NDRI, Inc. 71 West 23rd Street, 8th floor New York, NY 10010 tel: (212) 845-4495 (Tu, Th) tel: (732) 452-1424 (M, W, F) fax: (917) 438-0894
> I get a message that the polr function was not found.Did you remember to load the MASS library first? library(MASS) Hadley
"Peter Flom" <flom at ndri.org> writes:> Hello > > I am running R 1.8.1 on a Windows platform > > I am attempting to fit an ordinal logistic regression model, using the > polr function, as described in Venables and Ripley. But when I try > > model4 <- polr(ypsxcat~committed + as.factor(sex) > + as.factor(drugusey) + anycsw + as.factor(sex)*committed > + as.factor(sex)*as.factor(drugusey)+as.factor(sex)*anycsw, data > duhray) > > I get a message that the polr function was not found. > > Any help appreciatedlibrary(MASS) (and help.search("polr") might have given you the idea) -- 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
> help.search("polr")Help files with alias or concept or title matching 'polr' using regular expression matching: polr(MASS) Proportional Odds Logistic Regression Type 'help(FOO, package = PKG)' to inspect entry 'FOO(PKG) TITLE'. > Did you ask "library(MASS)" first? hope this helps. spencer graves Peter Flom wrote:>Hello > >I am running R 1.8.1 on a Windows platform > >I am attempting to fit an ordinal logistic regression model, using the >polr function, as described in Venables and Ripley. But when I try > >model4 <- polr(ypsxcat~committed + as.factor(sex) > + as.factor(drugusey) + anycsw + as.factor(sex)*committed > + as.factor(sex)*as.factor(drugusey)+as.factor(sex)*anycsw, data >duhray) > >I get a message that the polr function was not found. > >Any help appreciated > >thanks > >Peter > >Peter L. Flom, PhD >Assistant Director, Statistics and Data Analysis Core >Center for Drug Use and HIV Research >National Development and Research Institutes >71 W. 23rd St >www.peterflom.com >New York, NY 10010 >(212) 845-4485 (voice) >(917) 438-0894 (fax) > >______________________________________________ >R-help at stat.math.ethz.ch mailing list >https://www.stat.math.ethz.ch/mailman/listinfo/r-help >PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html > >
On 3 Mar 2004 at 15:42, Peter Flom wrote:> Hello > > I am running R 1.8.1 on a Windows platform > > I am attempting to fit an ordinal logistic regression model, using the > polr function, as described in Venables and Ripley. But when I tryIt would help if you started by saying library(MASS) Not knowing that, you could find out by trying help.search("polr") Kjetil Halvorsen> > model4 <- polr(ypsxcat~committed + as.factor(sex) > + as.factor(drugusey) + anycsw + as.factor(sex)*committed > + as.factor(sex)*as.factor(drugusey)+as.factor(sex)*anycsw, data > duhray) > > I get a message that the polr function was not found. > > Any help appreciated > > thanks > > Peter > > Peter L. Flom, PhD > Assistant Director, Statistics and Data Analysis Core > Center for Drug Use and HIV Research > National Development and Research Institutes > 71 W. 23rd St > www.peterflom.com > New York, NY 10010 > (212) 845-4485 (voice) > (917) 438-0894 (fax) > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.html