[R] Location of polr function

apjaworski@mmm.com apjaworski at mmm.com
Wed Mar 3 22:52:43 CET 2004


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




More information about the R-help mailing list