John Fox | 1 Oct 2004 02:34
Picon
Picon
Favicon

RE: [R] polr (MASS) and lrm (Design) differences in tests of statistical signifcance

Dear Paul,

I tried polr() and lrm() on a different problem and (except for the
difference in signs for the cut-points/intercepts) got identical results for
both coefficients and standard errors. There might be something
ill-conditioned about your problem that produces the discrepancy -- I
noticed, for example, that some of the upper categories of the response are
very sparse. Perhaps the two functions use different forms of the
information matrix. I expect that someone else will be able to supply more
details.

I believe that the t-statistics in the polr() output are actually Wald
statistics.

I hope this helps,
 John

> -----Original Message-----
> From: r-help-bounces <at> stat.math.ethz.ch 
> [mailto:r-help-bounces <at> stat.math.ethz.ch] On Behalf Of Paul Johnson
> Sent: Thursday, September 30, 2004 4:41 PM
> To: r help
> Subject: [R] polr (MASS) and lrm (Design) differences in 
> tests of statistical signifcance 
> 
> Greetings:
> 
> I'm running R-1.9.1 on Fedora Core 2 Linux.
> 
> I tested a proportional odds logistic regression with MASS's 
(Continue reading)

Zhen Pang | 1 Oct 2004 04:00
Picon
Favicon

Re: Vectorising and loop (was Re: [R] optim "alog-likelihoodfunction")

Thank you for your kind help. my s does not depend on the input theta. Code 
without loop is really efficient.

>From: Gabor Grothendieck <ggrothendieck <at> myway.com>
>To: r-help <at> stat.math.ethz.ch
>Subject: Re: Vectorising and loop (was Re: [R] optim 
>"alog-likelihoodfunction")
>Date: Thu, 30 Sep 2004 17:59:21 +0000 (UTC)
>
>Zhen Pang <nusbj <at> hotmail.com> writes:
>
>:
>: Mr. Grothendieck does suggest me to paste the data here. I just show a 
>small
>: one here. I must metion that I made a mistake in my former email. The 
>first
>: column should be j and is greater than the second column. I have 
>corrected
>: ll.
>:
>: z is the matrix below
>:
>: 2 1 3
>: 3 1 1
>: 3 3 1
>: 5 2 4
>:
>: k<-max(z[,1])
>: ll <- function(theta)
>:   {t<-0
(Continue reading)

Vikas Rawal | 1 Oct 2004 07:20
Picon

[R] Reading multiple files into R

I want to read data from a number of files into R.
Reading individual files one by one requires writing enormous amount of 
code that will look something like the following.

****************
maptools:::dbf.read("wb-01vc.dbf")->dist1
maptools:::dbf.read("wb-02vc.dbf")->dist2
maptools:::dbf.read("wb-03vc.dbf")->dist3
maptools:::dbf.read("wb-04vc.dbf")->dist4
maptools:::dbf.read("wb-05vc.dbf")->dist5
maptools:::dbf.read("wb-06vc.dbf")->dist6
maptools:::dbf.read("wb-07vc.dbf")->dist7
maptools:::dbf.read("wb-08vc.dbf")->dist8
maptools:::dbf.read("wb-09vc.dbf")->dist9
*****************

Is there a better way of doing this?

Vikas

______________________________________________
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

antonio rodriguez | 1 Oct 2004 08:31

RE: [R] Can't load rgl library

Hi Thomas,

Yes I have the xlibmesa-gl, libglu1-mesa, libglu1-mesa-dev, etc, libraries.
But no way. You mentioned TLS (transport Layer Security?), is this OK? I'm
working on a Toshiba laptop with graphics driver I852GM

Cheers,

Antonio

> -----Mensaje original-----
> De: r-help-bounces <at> stat.math.ethz.ch
> [mailto:r-help-bounces <at> stat.math.ethz.ch]En nombre de Thomas Schönhoff
> Enviado el: jueves, 30 de septiembre de 2004 19:16
> Para: R User-Liste
> Asunto: Re: [R] Can't load rgl library
>
>
>
> Hello,
>
> arv <at> ono.com schrieb:
> > Hi,
> >
> > I've installed rgl package through R CMD INSTALL on a
> Debian-Sarge machine
> > (PIV) without any compiling error (see attached file), but when
> trying to
> > load this package within R (and also Rcmdr library) I get:
> >
(Continue reading)

Witold Eryk Wolski | 1 Oct 2004 09:13
Picon
Favicon

Re: [R] Reading multiple files into R

Hi!
There is a function ?dir which returns you the content of the dir_ectory.
If this is more then there is a function ?grep which allows you to 
extract relevant items.
If you need to postprocess the names you have a function ?paste for example.
And finally you have an S language construct for(){}
And there is help.search() and An Introduction to R to which tells you 
how to write functions.

/E

Vikas Rawal wrote:

> I want to read data from a number of files into R.
> Reading individual files one by one requires writing enormous amount 
> of code that will look something like the following.
>
> ****************
> maptools:::dbf.read("wb-01vc.dbf")->dist1
> maptools:::dbf.read("wb-02vc.dbf")->dist2
> maptools:::dbf.read("wb-03vc.dbf")->dist3
> maptools:::dbf.read("wb-04vc.dbf")->dist4
> maptools:::dbf.read("wb-05vc.dbf")->dist5
> maptools:::dbf.read("wb-06vc.dbf")->dist6
> maptools:::dbf.read("wb-07vc.dbf")->dist7
> maptools:::dbf.read("wb-08vc.dbf")->dist8
> maptools:::dbf.read("wb-09vc.dbf")->dist9
> *****************
>
> Is there a better way of doing this?
(Continue reading)

Roger Bivand | 1 Oct 2004 09:17
Picon

Re: [R] Reading multiple files into R

On Fri, 1 Oct 2004, Vikas Rawal wrote:

> I want to read data from a number of files into R.
> Reading individual files one by one requires writing enormous amount of 
> code that will look something like the following.
> 
> ****************
> maptools:::dbf.read("wb-01vc.dbf")->dist1
> maptools:::dbf.read("wb-02vc.dbf")->dist2
> maptools:::dbf.read("wb-03vc.dbf")->dist3
> maptools:::dbf.read("wb-04vc.dbf")->dist4
> maptools:::dbf.read("wb-05vc.dbf")->dist5
> maptools:::dbf.read("wb-06vc.dbf")->dist6
> maptools:::dbf.read("wb-07vc.dbf")->dist7
> maptools:::dbf.read("wb-08vc.dbf")->dist8
> maptools:::dbf.read("wb-09vc.dbf")->dist9
> *****************
> 

In this case, you could pre-allocate a list and:

res <- vector(mode="list", length=9)
for (i in 1:length(res)) 
    res[[i]] <- maptools:::dbf.read(paste("wb-0", i, "vc.dbf", sep=""))

> res <- vector(mode="list", length=9)
> for (i in 1:length(res)) cat(paste("wb-0", i, "vc.dbf", sep=""), "\n")
wb-01vc.dbf 
wb-02vc.dbf 
wb-03vc.dbf 
(Continue reading)

J | 1 Oct 2004 09:21
Picon
Favicon

[R] two questions on nlme: error messages and nested variance

Hello:
Im hoping the list can shed light on two items.  I am
using an nlme model to fit a logistic function and
have these questions:

1)  The model works fine using varIdent(~1|factor) and
also using
varComb(varIdent(~1|factor),varFixed(~covariate)), but
not when varFixed(~covariate) is used alone.  Using
VarFixed alone gives the message: 

Error in recalc.varFunc(object[[i]], conLin) : dim<- :
dims [product 153] do not match the length of object
[846]  In addition: Warning message: longer object
length is not a multiple of shorter object length in:
conLin$Xy * varWeights(object).

Can anyone shed light on what this message means and
how I might go about fixing the problem?  I am still
new to all this, so please explain with that in mind.

2)  In my data, the mean of the variance of the
within-group errors is dependent on a covariate, and
in addition the variance of the variance is also
dependent on a covariate.  To model this would one use
something like: 
varIdent(~varIdent(~1|covariate)|covariate)?  I get
the same error message as above when I try this or if
I try: varIdent(~varFixed(~covariate)|factor).  Is
there a better way to do such nesting?  Is it even
(Continue reading)

Paul Lemmens | 1 Oct 2004 09:31
Picon

Re: [R] Reading multiple files into R

Hoi Vikas,

--On vrijdag 1 oktober 2004 10:50 +0530 Vikas Rawal <vikas <at> mail.jnu.ac.in> 
wrote:

> I want to read data from a number of files into R.
> Reading individual files one by one requires writing enormous amount of
> code that will look something like the following.
>
> Is there a better way of doing this?
>
These days I'm using the code below to read in each datafile I have, and 
come out with a single dataframe.

#  Concatenate the raw data files.
(datafiles <- list.files(path="../raw data/", pattern="pp.+\.dat$"))
tst <- do.call('rbind', lapply(datafiles, function(x) read.table(
  paste('../raw data/', x, sep=""), skip=1)))
rm(datafiles)

--

-- 
Paul Lemmens
NICI, University of Nijmegen              ASCII Ribbon Campaign /"\
Montessorilaan 3 (B.01.05)                    Against HTML Mail \ /
NL-6525 HR Nijmegen                                              X
The Netherlands                                                 / \
Phonenumber    +31-24-3612648
Fax            +31-24-3616066

______________________________________________
(Continue reading)

Thomas Schönhoff | 1 Oct 2004 09:44

Re: [R] Can't load rgl library

antonio rodriguez schrieb:
> Hi Thomas,
> 
> Yes I have the xlibmesa-gl, libglu1-mesa, libglu1-mesa-dev, etc, libraries.
> But no way. You mentioned TLS (transport Layer Security?), is this OK? I'm
> working on a Toshiba laptop with graphics driver I852GM

No, just look at /usr/share/  to find a diretory named /tls. It seems 
that if you are running NVidia chip with accelerated driver that wrong 
driver is loaded (IIRC, it was libnvidia.so1 or something similar).
Just rename the mentioned directory to tls_old (don't delete!) and try 
again to load your package.

Just an idea!

Thomas

______________________________________________
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

Pierre MONTPIED | 1 Oct 2004 09:48
Picon
Picon
Favicon

[R] gnls or nlme : how to obtain confidence intervals of fitted values

Hi

I use gnls to fit non linear models of the form y = alpha * x**beta 
(alpha and beta being linear functions of a 2nd regressor z i.e. 
alpha=a1+a2*z and beta=b1+b2*z) with variance function 
varPower(fitted(.)) which sounds correct for the data set I use.

My purpose is to use the fitted models for predictions with other sets 
of regressors x, z than those used in fitting. I therefore need to 
estimate y with (95%) confidence intervals.

Does any body knows how to do this with R ?

Thanks

______________________________________________
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


Gmane