[R] Re: pls regression - optimal number of LVs

2003-07-24 Thread Ron Wehrens
On Thursday 24 July 2003 05:02, Dowkiw, Arnaud wrote:
 Dear R-helpers,

 I have performed a PLS regression with the mvr function from the pls.pcr
 package an I have 2 questions : 1- do you know if mvr automatically centers
 the data ? It seems to me that it does so... 

Yup, it does... common practice.

 2- why in  the situation below
 does the output say that the optimal number of latent variables is 4 ? In
 my humble opinion, it is 2 because the RMS increases and the R2 decreases
 when 3 LVs are considered :

Many criteria exist and for some data sets they agree, for most they do not. 
The criterion applied here checks whether the decrease in cross-validated 
error is significant; Hastie et al. use it in their book The elements of 
statistical learning. It is described in the man page, and like all 
criteria, it is not guaranteed to satisfy all users. If you feel better using 
2LVs, you can do that. 

Ron

-- 
Ron Wehrens
Dept. of Chemometrics  
University of Nijmegen  Email: [EMAIL PROTECTED]
Toernooiveld 1  http://www-cac.sci.kun.nl/cac/
6525 ED NijmegenTel: +31 24 365 2053
The Netherlands Fax: +31 24 365 2653

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] nls.control in gnls

2003-07-24 Thread Claus Ekstroem
Hi,

I've made a selfStart function for use with gnls and the 
following piece of code works nicely:

check1 - gnls(y ~ spot.shape.fct(xcord, ycord, background, spotintensity, 
  rho, sigma, delta, mux, muy),
  start=getInitial(y ~ spot.shape.fct(xcord, ycord, 
   background, spotintensity, rho, 
   sigma, delta, mux, muy), data=claus),
  data=claus
  )

spot.shape.fct is the selfStart function and I later want to include 
a correlation term which is why I'm using gnls instead of nls. I want to 
get rid of the start= option, but I keep getting the following error 
message: 

Error in nls(formula = y ~ spot.shape.fct(xcord, ycord, background, 
spotintensity,  : 
number of iterations exceeded maximum of 50

From the help page and the glns code I can see that the initial start 
values are improved by estimating the parameters in a model without the 
correlation structures that are possible with gnls. This is quite 
reasonable and will quite likely improve the convergence succes and time 
once a correlation is introduced.

Obviously the call to nls does not converge before the standard 50 
iterations specified in nls.control so I was wondering if it is possible 
to pass nls.control information on to nls when calling gnls?

Several work-around exists:

* Write a better initial function to get more precise starting values, 
i.e., fewer iterations needed for nls.

* Make a new function  my.own.gnls  where nls.control(maxiter=100) is 
set in the call to nls.

Maybe it would even be a good idea to pass nlsMaxIter from gnlsControl 
on to the initial call to nls? As far as I can see from the code it is 
only used in maximization after the call to get the starting value.

Happy R'ing

Claus

-- 
*
Claus Thorn Ekstrøm [EMAIL PROTECTED]
Dept of Mathematics and Physics, KVL
Thorvaldsensvej 40
DK-1871 Frederiksberg C
Denmark
Phone:[+45] 3528 2341
Fax:  [+45] 3528 2350

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R]: performing marginal tests to glm objects

2003-07-24 Thread Eve Corda
Dear all,

I wonder if it is possible to obtain marginal tests for effects in generalized linear 
models. Indeed, the anova function produces sequential tests and it doesn't have any 
type argument to specify that we would like marginal tests instead, as in the 
similar anova function for lme objects. 

Thanks a lot for your help!

Eve CORDA
Office national de la chasse et de la faune sauvage 
(http://www.oncfs.gouv.fr)
BP 20 
78612 Le Perray en Yvelines Cedex
FRANCE
Phone: +33 (0)1 30 46 60 64
Fax: +33 (0)1 30 46 60 99
[EMAIL PROTECTED]


[[alternative HTML version deleted]]

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R]: performing marginal tests to glm objects

2003-07-24 Thread Prof Brian Ripley
?drop1 for the valid marginal tests.

If you want `type III' tests (which aren't marginal in the usual sense) 
see Anova in package car, which also does `type II' tests (as performed by 
drop1).

On Thu, 24 Jul 2003, Eve Corda wrote:

 I wonder if it is possible to obtain marginal tests for effects in
 generalized linear models. Indeed, the anova function produces
 sequential tests and it doesn't have any type argument to specify that
 we would like marginal tests instead, as in the similar anova function
 for lme objects.
 

-- 
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


RE: [R] Confidence Band for empirical distribution function

2003-07-24 Thread Hotz, T.
Dear Kjetil,

As I already mentioned, it appears that there isn't a function 
available calculating the quantiles directly (at least, it doesn't appear
in the C source of ctest). So as I already suggested, uniroot (or a similar
C routine which calls the corresponding C code directly) is probably the 
best you can do (apart from writing it completely yourself).

I didn't program this using uniroot, but I'd certainly try the following 
for speed-up:

- For symmetry reasons, you only need to compute half of the quantiles.
- The quantiles depend smoothly on the probabilities (of your reference
distribution). Therefore, calculating only a few for probabilities 
between 0 and 0.5, and using (e.g. linear) interpolation should be
satisfying.

I am sorry not be of more help.

HTH anyway

Thomas

 -Original Message-
 From: kjetil brinchmann halvorsen [mailto:[EMAIL PROTECTED]
 Sent: 23 July 2003 15:46
 To: Hotz, T.
 Subject: RE: [R] Confidence Band for empirical distribution function
 
 
 On 22 Jul 2003 at 11:37, Hotz, T. wrote:
 
  Dear Leif,
  
  If you look at the definition of ks.test, you'll find the lines
  
  pkstwo - function(x, tol = 1e-06) {
  if (is.numeric(x)) 
  x - as.vector(x)
  else stop(Argument x must be numeric)
  p - rep(0, length(x))
  p[is.na(x)] - NA
  IND - which(!is.na(x)  (x  0))
  if (length(IND)  0) {
  p[IND] - .C(pkstwo, as.integer(length(x)), p = 
 as.double(x[IND]), 
  as.double(tol), PACKAGE = ctest)$p
  }
  return(p)
  }
  
  which calls C code to calculate the p-values given the test 
 statistic.
  You'll find explanations on what this function does in the 
 original C file
  src/library/ctest/src/ks.c
  
  I haven't tried that but I assume that you could use it to 
 calculate p-values
  given the test-statistics yourself.
 
 That could certainly be done, but what was asked for is the inverse, 
 which can be calculated, using for instance uniroot(). I tried that, 
 but it is to slow, .C() will be called repeatedly in a loop. For me 
 it took several minutes.
 
 Kjetil Halvorsen
 
  
  Please also note that ks.test() returns the p-value as well.
  
  If you need quantiles, I assume you need to invert the cdf yourself,
  e.g. using uniroot().
  
  HTH
  
  Thomas

  ---
  
  Thomas Hotz
  Research Associate in Medical Statistics
  University of Leicester
  United Kingdom
  
  Department of Epidemiology and Public Health
  22-28 Princess Road West
  Leicester
  LE1 6TP
  Tel +44 116 252-5410
  Fax +44 116 252-5423
  
  Division of Medicine for the Elderly
  Department of Medicine
  The Glenfield Hospital
  Leicester
  LE3 9QP
  Tel +44 116 256-3643
  Fax +44 116 232-2976
  
  
   -Original Message-
   From: Leif.Boysen [mailto:[EMAIL PROTECTED]
   Sent: 21 July 2003 14:42
   To: [EMAIL PROTECTED]
   Subject: [R] Confidence Band for empirical distribution function
   
   
   Hi,
   
   I was trying to draw an empirical distribution function 
 with uniform
   confidence bands. So I tried to find a way to calculate 
 values of the
   Kolmogorov-Smirnov Distribution but failed.
   I guess it must be hidden somewhere (since the ks-test is 
   implemented),
   but I was unable to find it. 
   
   Is there any way to do this?
   
   Thanks
   
   Leif Boysen
   
   __
   [EMAIL PROTECTED] mailing list
   https://www.stat.math.ethz.ch/mailman/listinfo/r-help
  
  
  __
  [EMAIL PROTECTED] mailing list
  https://www.stat.math.ethz.ch/mailman/listinfo/r-help
 
 


__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] How can I represent a shape using 1-D discrete waveletdescriptor s?

2003-07-24 Thread qin.li
I only concern about the boundary of the shape and I dont concern gray
level. 
U[m] = x[m] + jy[m] m= 0,1,,N-1 is the N points on the boundary.
It is easy to express U as a discrete Fourier series. 
But it seems like that wd in the wavethresh package cannot deal with complex
values.
And it is not interesting to transfer U to a matrix.
Thanks a lot

Qin

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] R won't connect to the internet on Linux!

2003-07-24 Thread michael watson (IAH-C)
OK, I really am struggling with this one!  Forgive me if I am being stupid

I am running R 1.7.1 on Suse Linux 8.1.  I connect to the internet through a proxy so 
I have:

IAHC-LINUX03:~ # echo $http_proxy
wwwcache.bbsrc.ac.uk:8080
IAHC-LINUX03:~ # echo $HTTP_PROXY
wwwcache.bbsrc.ac.uk:8080

just in case ;-)

SO, i go into R and I get:

 source(http://www.bioconductor.org/getBioC.R;)
unable to connect to 'www.bioconductor.org' on port 80.
Error in file(file, r) : cannot open URL `http://www.bioconductor.org/getBioC.R'

OK so is R just not picking up my proxy setting?  It seems to be trying port 80 on 
something, and I have specifically set it to port 8080 in my environment variables.  
As far as I can see I have followed the reference manual suggestion, so does anyone 
else have one?

Thanks
Mick

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


RE: [R] Passing references to data objects into R functions

2003-07-24 Thread Henrik Bengtsson
One way is to use an object-oriented design and wrap up the reference
functionality in a common superclass. At
http://www.maths.lth.se/help/R/ImplementingReferences/ I have got some
discussions which are in line what you are trying to achieve and that
you might be able to adopt.

Also, note that passing huge objects as arguments to functions is NOT
expensive (considering memory or time) in R if they are used for
read-only purposes. It only becomes expensive if you assign a new value
to the argument. In such cases R *has to* copy the whole object to make
sure you only modify a local instance of the object. Thus, objects can
be though of being passed by reference to functions as long as they are
not modified, if modified they are passed by value. This is intentional
as R is a (one-threaded) functional language. 

Best wishes

Henrik Bengtsson
Lund University

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of David 
 Khabie-Zeitoune
 Sent: den 23 juli 2003 18:18
 To: [EMAIL PROTECTED]
 Subject: [R] Passing references to data objects into R functions
 
 
 Hi. 
 
 I have the following question about reading from large data 
 objects from within R functions; I have tried to simplify my 
 problem as much as possible in what follows.
 
 Imagine I have various large data objects sitting in my 
 global environment (call them data1, data2, ...).  I want 
 to write a function extract that extracts some of the rows 
 of a particular data object, does some further manipulations 
 on the extract and then returns the result. The function 
 takes the data object's name and an index vector -- for 
 example the following call would return the first 3 rows of 
 object data1. 
 
 ans = extract(data1, 1:3)
 
 I could write a simple function like this:
 
 extract1 = function(object.name, index) {
 
 temp = get(object.name, envir = .GlobalEnv)
 temp = temp[index, , drop=FALSE]
 
 # do some further manipulations here 
 
 return(temp)
 
 }
 
 The problem is that the function makes a copy temp of the 
 object in the function frame, which (in my application) is 
 very memory inefficient as the data objects are very large. 
 It is especially inefficient when the length of the index 
 vector is much smaller than the number of rows in the data 
 object. What I really would like to do is to be able to read 
 from the underlying data object directly (in other 
 programming languages this would be achieved by passing a 
 pointer to the object instead), without making a copy.
 
 Given the rules of variable name scoping in R, I could avoid 
 making a copy with the following call:
 
 extract2 = function(object.name, index) {
 
 eval(parse(text = temp = , object.name, [index, , drop=FALSE],
 sep=))
 # do some further manipulations here 
 
 return(temp)
 }
 
 But this seems very messy. Is there a better way?
 
 Thanks for your help
 
 David Khabie-Zeitoune
 
 __
 [EMAIL PROTECTED] mailing list 
 https://www.stat.math.ethz.ch/mailman/listinfo /r-help

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] median and joint distribution

2003-07-24 Thread Salvatore Barbaro
Dear R-helpers!

May I kindly ask the pure statistics-experts to help me for a
purpose which first part is not directly concerned with R.
Consider two distribution functions, say f and g. For both, the
median is smaller than a half. Now, the multiplicative or additive
linkage of both distribution leads to a new distribution function,
say h, whereas the median of h is greater than a half. Does
anybody know under which circumstances such a construction of h is
possible (my intuition is that it depends on the correlation of f
and g) or can anybody advice a helpful literature. Furthermore,
does anybody know whether or how such a construction can be done
with R. Thanks in advance.

s.

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] S3 and S4 classes

2003-07-24 Thread Laurent Faisnel
I've made some changes (in bold) following your comments :

# class definition :
setClass(MyClass, representation(mynumber=numeric));

# the initilization method :
setMethod(initialize,MyClass,
 function(.Object)
 {
   [EMAIL PROTECTED] - 10;
   return(.Object);
 }
);

# defining the generic function  generates a warning message (already 
generic function)- but everything works fine without it - so it seems 
better not to use it
*setGeneric(perform, function(object) standardGeneric(perform));
*
# the perform method definition - this alone seems sufficient for me, 
and S4-looking
*setMethod(perform,MyClass,**
 function(object) {
   [EMAIL PROTECTED] - [EMAIL PROTECTED] + 10;
   return(object);
 } **);*
  
 I replaced my unlucky /.Object/ by /object/ but for method initialize.
The execution of my program used to begin with an output like :

Creating a new generic function for perform

With the setMethod only, there is not this output any longer. Does this 
mean that the execution becomes faster ?

Thank you for your fast and useful answers. I've found an interesting R 
help page I had never seen before at 
http://www.maths.lth.se/help/R/S3toS4 which gives additionnal 
information about S3 and S4 classes.

Regards,
Laurent

http://www.maths.lth.se/help/R/S3toS4/

[[alternative HTML version deleted]]

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] R won't connect to the internet on Linux!

2003-07-24 Thread Prof Brian Ripley
On Thu, 24 Jul 2003, michael watson (IAH-C) wrote:

 OK, I really am struggling with this one!  Forgive me if I am being stupid

 I am running R 1.7.1 on Suse Linux 8.1.  I connect to the internet
 through a proxy so I have:
 
 IAHC-LINUX03:~ # echo $http_proxy
 wwwcache.bbsrc.ac.uk:8080
 IAHC-LINUX03:~ # echo $HTTP_PROXY
 wwwcache.bbsrc.ac.uk:8080
 
 just in case ;-)
 
 SO, i go into R and I get:
 
  source(http://www.bioconductor.org/getBioC.R;)
 unable to connect to 'www.bioconductor.org' on port 80.
 Error in file(file, r) : cannot open URL `http://www.bioconductor.org/getBioC.R'
 
 OK so is R just not picking up my proxy setting?  

Your setting is wrong, so it is being ignored.  The help page says
quite explicitly

  The form of `http_proxy' should be `http://proxy.dom.com/;' or
 `http://proxy.dom.com:8080/;' where the port defaults to `80' and
 the trailing slash may be omitted.

 It seems to be trying
 port 80 on something, and I have specifically set it to port 8080 in my
 environment variables.  As far as I can see I have followed the
 reference manual suggestion, so does anyone else have one?

The problem is in your seeing, it seems.

-- 
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] geoR size limit problem

2003-07-24 Thread Miha STAUT
Hi all,

I tried to produce some kriged surfaces with geoR (latest version). The size 
of the grid should be around 900 x 650 cells (what I find is not a very big 
grid), and the number of points is around 2500. The command krige.conv 
stopped after arround 5 min saying it can not allocate a vector with around 
1.5 billion units. Sounds reasonable.

Is there a workaround? How would I partition the map into several smaller 
pieces to krige them separately and retain the smooth transitions from one 
part to another? Is there a possibility to apply a mask to the grid in a 
way that it only interpolates the cells of interest?

My machine has 512MB of memory and additional 2000MB of swap.

Thanks in advance, Miha Staut

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] Condition indexes and variance inflation factors

2003-07-24 Thread Peter Flom
Thanks for all the help.

Juergen Gross supplied a program which does just what Belsley
suggested.

Chuck Cleland, John Fox and Andy Liaw all made useful programming
suggestions.

John Fox asked


(1) I've never liked this approach for a model with a constant, where
it 
makes more sense to me to centre the data. I realize that opinions
differ 
here, but it seems to me that failing to centre the data conflates 
collinearity with numerical instability.


Opinions do differ.  A few years ago, I could have given more details
(my dissertation was on this topic, but a lot of the details have
disappeared from memory); I think, though, that Belsley is looking for a
measure that deals not only with collinearity, but with several other
problems, including numerical instability (the subtitle of his later
book is Collinearity and Weak Data in Regression).  I remember being
convinced that centering was generally not a good idea, but there are
lots of people who disagree and who know a lot more statistics than I
do.


(2) I also disagree with the comment that condition indices are easier
to 
interpret than variance-inflation factors. In either case, since 
collinearity is a continuous phenomenon, cutoffs for large values are 
necessarily arbitrary.


While any cutoff is arbitrary (and Belsley advises against using a
cutoff rigidly) he does provide some evidence of how regression models
with different condition indices are affected by them.


(3) If you're interested in figuring out which variables are involved
in 
each collinear relationship, then (for centred and scaled data) you can

equivalently (and to me, more intuitively) work with the 
principal-components analysis of the predictors.


This would also work.  


(4) I have doubts about the whole enterprise. Collinearity is one
source of 
imprecision -- others are small sample size, homogeneous predictors,
and 
large error variance. Aren't the coefficient standard errors the bottom

line? If these are sufficiently small, why worry?


I think (correct me if I am wrong) that the s.e.s and the condition
indices serve very different purposes.  The condition indices are
supposed to determine if small changes in the input data could make big
differences in the results.  Belsley provides some examples where a tiny
change in the data results in completely different results (e.g.,
different standard errors, different coefficients (even reversing sign)
and so on).  



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)

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] median and joint distribution

2003-07-24 Thread Roger Koenker
For distribution functions F and G we have the (Frechet) bounds:

max{0, F(x)+G(y) -1} = H(x,y) = min{F(x),F(y)}

where H is the joint df of (X,Y) having marginals F and G.  If
X and Y are comonotonic (Schmeidler (Econometrica, 1989)), that is
if there is a random variable Z, such that X = f(Z), and Y=g(Z)
for monotone f and g, then the upper Frechet bound holds and the
quantile function of X+Y is the sum of the quantile functions of
X and Y.  For multiplicative linkage take logs, presuming, of
course, that I'm not misinterpreting this phrase.  One can think
of comonotone X and Y as perfectly concordant in the language
of rank correlation.



url:www.econ.uiuc.edu/~roger/my.htmlRoger Koenker
email   [EMAIL PROTECTED]   Department of Economics
vox:217-333-4558University of Illinois
fax:217-244-6678Champaign, IL 61820

On Thu, 24 Jul 2003, Salvatore Barbaro wrote:

 Dear R-helpers!

 May I kindly ask the pure statistics-experts to help me for a
 purpose which first part is not directly concerned with R.
 Consider two distribution functions, say f and g. For both, the
 median is smaller than a half. Now, the multiplicative or additive
 linkage of both distribution leads to a new distribution function,
 say h, whereas the median of h is greater than a half. Does
 anybody know under which circumstances such a construction of h is
 possible (my intuition is that it depends on the correlation of f
 and g) or can anybody advice a helpful literature. Furthermore,
 does anybody know whether or how such a construction can be done
 with R. Thanks in advance.

 s.

 __
 [EMAIL PROTECTED] mailing list
 https://www.stat.math.ethz.ch/mailman/listinfo/r-help


__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


RE: [R] median and joint distribution

2003-07-24 Thread Hotz, T.
Dear Salvatore,

Assuming that you mean convolution when you write
additive linkage, the answer is that there is no general 
answer. It will depend heavily on the joint distribution
of the two random variables.

Just to give a simple example, let X~f, Y~g, and
P(X=0.4)=P(Y=0.4)=1. Then, X and Y are independent, their
medians are 0.5, but there sum has a median 0.5.

Its different for multiplicative, since in general from
X~f, Y~f, P(X=0.5)=0.5, and P(Y=0.5)=0.5 it follows
that P(XY=0.5) = P(X=p or Y=q) if p*q=0.5. Thus, if there
are numbers p and q with that property, such that
P(X=p) + P(Y=q) = 0.5, then the median of XY will be =0.5.

You might argue that there is a relationship between additive
and multiplicative scale through a log-transformation (note that
the median is stable under monotone transformations). However,
I assume there is no obvious formulation of the above statement
on the additive scale.

There is no way of carrying convolutions out in R directly; you'd
need to do numerical integration to do that, e.g. using 
integrate().

HTH

Thomas

---

Thomas Hotz
Research Associate in Medical Statistics
University of Leicester
United Kingdom

Department of Epidemiology and Public Health
22-28 Princess Road West
Leicester
LE1 6TP
Tel +44 116 252-5410
Fax +44 116 252-5423

Division of Medicine for the Elderly
Department of Medicine
The Glenfield Hospital
Leicester
LE3 9QP
Tel +44 116 256-3643
Fax +44 116 232-2976


 -Original Message-
 From: Salvatore Barbaro [mailto:[EMAIL PROTECTED]
 Sent: 24 July 2003 12:56
 To: [EMAIL PROTECTED]
 Subject: [R] median and joint distribution
 
 
 Dear R-helpers!
 
 May I kindly ask the pure statistics-experts to help me for a
 purpose which first part is not directly concerned with R.
 Consider two distribution functions, say f and g. For both, the
 median is smaller than a half. Now, the multiplicative or additive
 linkage of both distribution leads to a new distribution function,
 say h, whereas the median of h is greater than a half. Does
 anybody know under which circumstances such a construction of h is
 possible (my intuition is that it depends on the correlation of f
 and g) or can anybody advice a helpful literature. Furthermore,
 does anybody know whether or how such a construction can be done
 with R. Thanks in advance.
 
 s.
 
 __
 [EMAIL PROTECTED] mailing list
 https://www.stat.math.ethz.ch/mailman/listinfo/r-help


__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


RE: [R] R won't connect to the internet on Linux!

2003-07-24 Thread michael watson (IAH-C)
Hello Professor

If you are suggesting that I am simply missing the http://; part of my cache URL, or 
that I am missing a trailing /, then I pre-empted this response and it still doesn't 
work.

I have tried setting both http_proxy and HTTP_PROXY to all of:

wwwcache.bbsrc.ac.uk:8080
http://wwwcache.bbsrc.ac.uk:8080
wwwcache.bbsrc.ac.uk:8080/
http://wwwcache.bbsrc.ac.uk:8080/

and I still get the same response - R cannot open the URL.

And yes, that is thw right proxy address, I copied it straight from Netscape on the 
same computer, and Netscape connects to the internet fine.

Thanks
Mick
 

-Original Message-
From: Prof Brian Ripley [mailto:[EMAIL PROTECTED]
Sent: 24 July 2003 13:17
To: michael watson (IAH-C)
Cc: '[EMAIL PROTECTED] '
Subject: Re: [R] R won't connect to the internet on Linux!


On Thu, 24 Jul 2003, michael watson (IAH-C) wrote:

 OK, I really am struggling with this one!  Forgive me if I am being stupid

 I am running R 1.7.1 on Suse Linux 8.1.  I connect to the internet
 through a proxy so I have:
 
 IAHC-LINUX03:~ # echo $http_proxy
 wwwcache.bbsrc.ac.uk:8080
 IAHC-LINUX03:~ # echo $HTTP_PROXY
 wwwcache.bbsrc.ac.uk:8080
 
 just in case ;-)
 
 SO, i go into R and I get:
 
  source(http://www.bioconductor.org/getBioC.R;)
 unable to connect to 'www.bioconductor.org' on port 80.
 Error in file(file, r) : cannot open URL `http://www.bioconductor.org/getBioC.R'
 
 OK so is R just not picking up my proxy setting?  

Your setting is wrong, so it is being ignored.  The help page says
quite explicitly

  The form of `http_proxy' should be `http://proxy.dom.com/;' or
 `http://proxy.dom.com:8080/;' where the port defaults to `80' and
 the trailing slash may be omitted.

 It seems to be trying
 port 80 on something, and I have specifically set it to port 8080 in my
 environment variables.  As far as I can see I have followed the
 reference manual suggestion, so does anyone else have one?

The problem is in your seeing, it seems.

-- 
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


RE: [R] S3 and S4 classes

2003-07-24 Thread Henrik Bengtsson
 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of Laurent Faisnel
 Sent: den 24 juli 2003 14:04
 To: John Chambers
 Cc: [EMAIL PROTECTED]; Duncan Murdoch
 Subject: Re: [R] S3 and S4 classes
 

[snip]

 Thank you for your fast and useful answers. I've found an 
 interesting R 
 help page I had never seen before at 
 http://www.maths.lth.se/help/R/S3toS4 which gives additionnal 
 information about S3 and S4 classes.

Beware that I haven't updated this page since early 2002, it is based on
early versions of the 'methods' package and my early understandings of
it and is likely to be out of date (I'll put a note about this on the
page as soon as I get access to the server). 
 
 Regards,
 Laurent

Have a nice day!

Henrik Bengtsson
Lund University

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: Re[2]: [R] lattice: how to format axis labels?

2003-07-24 Thread Alan Davis
On 23 Jul 2003 09:12:07 -0500
Douglas Bates [EMAIL PROTECTED] wrote:

 High-level control of axes in xyplot is implemented by the scales
 argument to xyplot.  You can include components 'at' and 'labels' in
 a list given as the scales argument.  See ?xyplot.
 
 Wladimir Eremeev [EMAIL PROTECTED] writes:
 
  jhcc check out 'sprintf' for formating in a specific way.
  
  This will not solve the problem.
  I will have to specify the argument like labels=(...).
  I would like to avoid it.
  
  I wonder if there a key or option to make automatically appearing
  labels be formatted in the mentioned way.
  I haven't found it in the documentation.
  
  =
  jhcc   I draw graphics with xyplot() function.
  jhcc   Labels on the y axis are appearing as follows: 1.5, 1, 0.5,
  0
  
  jhcc   I'd like to have them to be 1.5, 1.0, 0.5, 0.0, i.e. with
  fixed jhcc   number of digits after the dot (one in this case).
  
  jhcc   Is there any way to do this without implicit specifying
  labels?
 
 I don't think so.
 
 __
 [EMAIL PROTECTED] mailing list
 https://www.stat.math.ethz.ch/mailman/listinfo/r-help
 


-- 
[EMAIL PROTECTED] 1-670-322-6580
Alan E. Davis,  PMB 30, Box 10006, Saipan, MP 96950-8906, CNMI

I have steadily endeavored to keep my mind free, so as to give up any
hypothesis, however much beloved -- and I cannot resist forming one 
on every subject -- as soon as facts are shown to be opposed to it.  
  -- Charles Darwin (1809-1882)

The right to search for truth implies also a duty; one must not
conceal any part of what one has recognized to be true. 
  -- Albert Einstein 

As we enjoy great advantages from the inventions of others we should
be glad of an opportunity to serve others by any invention of
ours, and this we should do freely and generously.
  -- Benjamin Franklin

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] Condition indexes and variance inflation factors

2003-07-24 Thread John Fox
Dear Peter,

At 08:24 AM 7/24/2003 -0400, Peter Flom wrote:

(1) I've never liked this approach for a model with a constant, where
it
makes more sense to me to centre the data. I realize that opinions
differ
here, but it seems to me that failing to centre the data conflates
collinearity with numerical instability.

Opinions do differ.  A few years ago, I could have given more details
(my dissertation was on this topic, but a lot of the details have
disappeared from memory); I think, though, that Belsley is looking for a
measure that deals not only with collinearity, but with several other
problems, including numerical instability (the subtitle of his later
book is Collinearity and Weak Data in Regression).  I remember being
convinced that centering was generally not a good idea, but there are
lots of people who disagree and who know a lot more statistics than I
do.
To elaborate my remark slightly, in most problems the intercept is not of 
much interest. When the data are far from the origin, it's natural that the 
intercept isn't well estimated. When data are very far from the origin, 
computations with the uncentred data may be numerically unstable (depending 
upon how the computations are done) because of collinearity with the 
intercept. If the real interest is in the coefficients other than the 
intercept, this seems to me purely a numerical artefact. The possibly more 
generally interesting sense of collinearity is imprecision in estimation 
due to strong relationships among the predictors.

. . .



(4) I have doubts about the whole enterprise. Collinearity is one
source of
imprecision -- others are small sample size, homogeneous predictors,
and
large error variance. Aren't the coefficient standard errors the bottom
line? If these are sufficiently small, why worry?

I think (correct me if I am wrong) that the s.e.s and the condition
indices serve very different purposes.  The condition indices are
supposed to determine if small changes in the input data could make big
differences in the results.  Belsley provides some examples where a tiny
change in the data results in completely different results (e.g.,
different standard errors, different coefficients (even reversing sign)
and so on).
Indeed, ill-conditioned data produce unstable numerical solutions (even 
affected by how the data are rounded), but condition indices aren't a 
particularly effective way of looking for instability in a more general 
sense. Consider, for example, Anscombe's famous simple-regression examples, 
which are in the data frame Quartet in the car package. The fourth example 
has a highly influential data point (number 8):

 Quartet[, c(x4, y4)]
   x4y4
1   8  6.58
2   8  5.76
3   8  7.71
4   8  8.84
5   8  8.47
6   8  7.04
7   8  5.25
8  19 12.50
9   8  5.56
10  8  7.91
11  8  6.89
The regression of y4 on x4 isn't especially ill-conditioned (using the 
function I posted yesterday):

 mod - lm(y4 ~ x4)
 belsley(mod)
Singular values:  1.394079 0.2377891
Condition indices:  1 5.86267
Variance-decomposition proportions
  (Intercept)x4
1   0.028 0.028
2   0.972 0.972
but the 8th observation has an infinite Cook's D:

 round(cooks.distance(mod), 2)
   123456789   10   11
0.01 0.06 0.02 0.14 0.09 0.00 0.12  Inf 0.08 0.03 0.00
Regards,
 John
-
John Fox
Department of Sociology
McMaster University
Hamilton, Ontario, Canada L8S 4M4
email: [EMAIL PROTECTED]
phone: 905-525-9140x23604
web: www.socsci.mcmaster.ca/jfox
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


RE: [R] Dismal R performance of Athlon moble CPU?

2003-07-24 Thread Thomas Lumley
On Wed, 23 Jul 2003, Jason Liao wrote:

 Thanks for Prof. Ripley and Andy for your technical explantion. It
 seems that that the real CPU speed has not advanced as fast as these
 Ghz or other performance indicator suggest.

 Yes, my program is totally CPU intensive.


It may not be even if you think it is. Note that much of the speed
increase that ATLAS achieves comes from optimal use of various levels of
cache. It's quite possible that your code is actually limited by memory
bandwidth.

In any case, I think R is often limited by integer rather than
floating point peformance.  Back in the days when I timed things in R, its
relative performance across PCs and Sparcs suggested that floating point
wasn't a big deal.


-thomas

Thomas Lumley   Assoc. Professor, Biostatistics
[EMAIL PROTECTED]   University of Washington, Seattle

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


RE: [R] R won't connect to the internet on Linux!

2003-07-24 Thread michael watson (IAH-C)
You're right, I have tried keeping the double quotes in there too and that doesn't work
 
What is clear is that R is completely ignoring my http_proxy environment variable, as 
it's error says unable to connect on port 80, when every single one of my http_proxy 
attempts has stipulates port 8080 I know for a fact that my proxy isn't going to 
work on port 80.
 
So what I need to know is why R is choosing to ignore http_proxy

-Original Message-
From: Bashir Saghir (Aztek Global) [mailto:[EMAIL PROTECTED]
Sent: 24 July 2003 15:06
To: 'michael watson (IAH-C)'
Subject: RE: [R] R won't connect to the internet on Linux!



I'm not 100% sure but I think the double quotes are needed too. You've probably done 
this too. 
Saghir 

-Original Message- 
From:   michael watson (IAH-C) [SMTP:[EMAIL PROTECTED] 
Sent:   Thursday, 24 July, 2003 3:16 PM 
To: 'Prof Brian Ripley' 
Cc: '[EMAIL PROTECTED] ' 
Subject:RE: [R] R won't connect to the internet on Linux! 

Hello Professor 

If you are suggesting that I am simply missing the  http:// http://  part 
of my cache URL, or that I am missing a trailing /, then I pre-empted this response 
and it still doesn't work.

I have tried setting both http_proxy and HTTP_PROXY to all of: 

wwwcache.bbsrc.ac.uk:8080 
http://wwwcache.bbsrc.ac.uk:8080 http://wwwcache.bbsrc.ac.uk:8080  
wwwcache.bbsrc.ac.uk:8080/ 
http://wwwcache.bbsrc.ac.uk:8080/ http://wwwcache.bbsrc.ac.uk:8080/  

and I still get the same response - R cannot open the URL. 

And yes, that is thw right proxy address, I copied it straight from Netscape 
on the same computer, and Netscape connects to the internet fine.

Thanks 
Mick 
  

-Original Message- 
From: Prof Brian Ripley [ mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] ] 
Sent: 24 July 2003 13:17 
To: michael watson (IAH-C) 
Cc: '[EMAIL PROTECTED] ' 
Subject: Re: [R] R won't connect to the internet on Linux! 


On Thu, 24 Jul 2003, michael watson (IAH-C) wrote: 

 OK, I really am struggling with this one!  Forgive me if I am being 
stupid 

 I am running R 1.7.1 on Suse Linux 8.1.  I connect to the internet 
 through a proxy so I have: 
 
 IAHC-LINUX03:~ # echo $http_proxy 
 wwwcache.bbsrc.ac.uk:8080 
 IAHC-LINUX03:~ # echo $HTTP_PROXY 
 wwwcache.bbsrc.ac.uk:8080 
 
 just in case ;-) 
 
 SO, i go into R and I get: 
 
  source( http://www.bioconductor.org/getBioC.R 
  http://www.bioconductor.org/getBioC.R ) 
 unable to connect to 'www.bioconductor.org' on port 80. 
 Error in file(file, r) : cannot open URL ` http://www.bioconductor.org/getBioC.R' 
 http://www.bioconductor.org/getBioC.R'  
 
 OK so is R just not picking up my proxy setting?  

Your setting is wrong, so it is being ignored.  The help page says 
quite explicitly 

  The form of `http_proxy' should be ` http://proxy.dom.com/ 
http://proxy.dom.com/ ' or 
 ` http://proxy.dom.com:8080/ http://proxy.dom.com:8080/ ' where the port 
defaults to `80' and 
 the trailing slash may be omitted. 

 It seems to be trying 
 port 80 on something, and I have specifically set it to port 8080 in my 
 environment variables.  As far as I can see I have followed the 
 reference manual suggestion, so does anyone else have one? 

The problem is in your seeing, it seems. 

-- 
Brian D. Ripley,  [EMAIL PROTECTED] 
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/ 
http://www.stats.ox.ac.uk/~ripley/  
University of Oxford, Tel:  +44 1865 272861 (self) 
1 South Parks Road, +44 1865 272866 (PA) 
Oxford OX1 3TG, UKFax:  +44 1865 272595 

__ 
[EMAIL PROTECTED] mailing list 
https://www.stat.math.ethz.ch/mailman/listinfo/r-help 
https://www.stat.math.ethz.ch/mailman/listinfo/r-help  


- 
Legal Notice: This electronic mail and its attachments are i...{{dropped}}

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] data.frame subsetting

2003-07-24 Thread Dirk Repsilber
Hi,

is there advice how to subset a data.frame, where until R version 1.7.0 
it was possible to write

 data[[subset]]

which meant the same as

 data$subset

(data is a data.frame). From 1.7.1 on this does not seem to work longer. 
Could there be a bug in downwards compatibility?

sincerely yours

Dirk

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] trellis plot question

2003-07-24 Thread Suzette Blanchard

Greetings,

Does anyone know how to get an id number in the little header 
above each individual plot within a trellis plot?  The default
seems to be to print the word id and add a line indicating on
a linear scale where the current id sits.

Thanks in advance for any help you can send,

Suzette


=
Suzette Blanchard, Ph.D.
Research Scientist
Frontier Science Foundation
1244 Boylston St. Suite 303
Chestnut Hill, MA 02467
Email:  [EMAIL PROTECTED]
Phone:  (617) 632-2007
Fax:(617) 632-2001

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] Problem w/ source

2003-07-24 Thread Peter Muhlberger
I'm trying to use the source command to run commands from a file.  For
instance:  source(do.R), where do.R is a file in the same directory in
which I am running R.

The contents of do.R are:

ls()
print(hello)
sum(y1)
mean(y1)


After  source(do.R), all I see is:

 source(do.R)
[1] hello


I'm using the X11 version of R for Mac OS X (downloadable binary).  Does
anyone know how to get source to work?

Thanks!

Peter

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] R benchmark, moble Pentium III, 1.13 GHs

2003-07-24 Thread Jason Liao
I got the following using the benchmark program at
http://www.sciviews.org/other/benchmark.htm

under Windows 2000 prof., 256 MB of RAM

 R Benchmark 2
   =
Number of times each test is run__:  3

   I. Matrix calculation
   -
Creation, transp., deformation of a 1500x1500 matrix (sec): 
1.97 
800x800 normal distributed random matrix ^1000__ (sec): 
2.80 
Sorting of 2,000,000 random values__ (sec): 
1.20 
700x700 cross-product matrix (b = a' * a)___ (sec): 
1.84 
Linear regression over a 600x600 matrix (c = a \ b') (sec): 
2.43 
  
 Trimmed geom. mean (2 extremes eliminated): 
2.06825841067831 

   II. Matrix functions
   
FFT over 800,000 random values__ (sec): 
1.61 
Eigenvalues of a 320x320 random matrix__ (sec): 
1.20 
Error in eval(expr, envir, enclos) : couldn't find function
det.Matrix
Timing stopped at: 0 0 0 NA NA 
 



=
Jason G. Liao, Ph.D.
Division of Biometrics
University of Medicine and Dentistry of New Jersey
335 George Street, Suite 2200
New Brunswick, NJ 08903-2688
phone (732) 235-8611, fax (732) 235-9777
http://www.geocities.com/jg_liao

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] Plotting math functions

2003-07-24 Thread Jonck van der Kogel
Hi all,
I was wondering whether it is possible to plot math functions, for 
example sin, cos or a Gaussian type function, in R, and if so, how to 
do it. I have been searching through the archives and the R manual but 
had no luck in finding any hints on how to go about this.
Any help is much appreciated!
Thanks, Jonck

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] Plotting math functions

2003-07-24 Thread Uwe Ligges
Jonck van der Kogel wrote:
Hi all,
I was wondering whether it is possible to plot math functions, for 
example sin, cos or a Gaussian type function, in R, and if so, how to do 
it. I have been searching through the archives and the R manual but had 
no luck in finding any hints on how to go about this.
Any help is much appreciated!
Thanks, Jonck

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
See ?curve

Uwe Ligges

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] Condition indexes and variance inflation factors

2003-07-24 Thread Peter Flom
Dear John

An interesting discussion!

I would be the last to suggest ignoring such diagnostics as Cook's D;
as you point out, it diagnoses a problem which condition indices do not:
Whether a point is influential.

OTOH, condition indices diagnose a problem which Cook's D does not:
Would shifting the data slightly change the results.

Consider the data given in Belsley (1991) on p. 5

y -   c( 3.3979, 1.6094, 3.7131, 1.6767, 0.0419, 3.3768, 1.1661,
0.4701)
x2a - c(-3.138, -0.297, -4.582, 0.301, 2.729, -4.836, 0.065, 4.102)
x2b - c(-3.136, -0.296, -4.581, 0.300, 2.730, -4.834, 0.064, 4.103)
x3a - c(1.286, 0.250, 1.247, 0.498, -0.280, 0.350, 0.208, 1.069)
x3b - c(1.288, 0.251, 1.246, 0.498, -0.281, 0.349, 0.206, 1.069)
x4a - c(0.169, 0.044, 0.109, 0.117, 0.035, -0.094, 0.047, 0.375)
x4b - c(0.170, 0.043, 0.108, 0.118, 0.036, -0.093, 0.048, 0.376)

where x2a , x3a and x4a are very similar to x2b, x3b and x4b,
respecttively, and where both are generated from

y = 1.2I  - 0.4 x2 + 0.6x3 + 0.9x4 + e

e ~ N(0, 0.01)

Then 
modela - lm(y~ x2a + x3a + x4a)
and 
modelb - lm(y~x2b + x3b + x4b)

give radically different results, with neither having any significant
parameters other than the intercept.  Admittedly, the standard errors
for a couple of the parameters are large.  But why are they large? I
have certainly dealt with models with large standard errors that have
nothing to do with collinearity.

here, the function PI.lm (supplied by Juergen Gross) gives huge
condition indices, and indicates that the nature of the problem is that
all three of the x variables are highly collinear.

Variance-Decomposition Proportions for
Scaled Condition Indexes:

(Intercept) x2b x3b x4b
10.0494   0   0   0
10.0009   0   0   0
30.8101   0   0   0
464  0.1396   1   1   1


Regards

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)

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] Problem w/ source

2003-07-24 Thread Uwe Ligges
Peter Muhlberger wrote:

I'm trying to use the source command to run commands from a file.  For
instance:  source(do.R), where do.R is a file in the same directory in
which I am running R.
The contents of do.R are:

ls()
print(hello)
sum(y1)
mean(y1)
After  source(do.R), all I see is:


source(do.R)
[1] hello

I'm using the X11 version of R for Mac OS X (downloadable binary).  Does
anyone know how to get source to work?
Thanks!

Peter



Works perfectly, but no automatic print() is executed as the default 
when sourcing. When you want the other objects to be printed either use
  print(ls())
  print(sum(y1))
  ...
or use
  source(do.R, print.eval = TRUE)
as described in ?source.

Uwe Ligges

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] data.frame subsetting

2003-07-24 Thread Uwe Ligges
Dirk Repsilber wrote:

Hi,

is there advice how to subset a data.frame, where until R version 1.7.0 
it was possible to write

  data[[subset]]

which meant the same as

  data$subset

(data is a data.frame). From 1.7.1 on this does not seem to work longer. 
Could there be a bug in downwards compatibility?

sincerely yours
Works for me. Are you sure the object data is a data.frame in your case?

Uwe Ligges

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


RE: [R] Plotting math functions

2003-07-24 Thread RBaskin


 I was wondering whether it is possible to plot math functions, for example
sin ...

also maybe:
?plot

snipped from the help page
Examples:
...
 plot(sin, -pi, 2*pi)
unsnip

bob



-Original Message-
From: Uwe Ligges [mailto:[EMAIL PROTECTED] 
Sent: Thursday, July 24, 2003 11:04 AM
To: Jonck van der Kogel
Cc: [EMAIL PROTECTED]
Subject: Re: [R] Plotting math functions

Jonck van der Kogel wrote:
 Hi all,
 I was wondering whether it is possible to plot math functions, for 
 example sin, cos or a Gaussian type function, in R, and if so, how to do 
 it. I have been searching through the archives and the R manual but had 
 no luck in finding any hints on how to go about this.
 Any help is much appreciated!
 Thanks, Jonck
 
 __
 [EMAIL PROTECTED] mailing list
 https://www.stat.math.ethz.ch/mailman/listinfo/r-help

See ?curve

Uwe Ligges

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help

[[alternative HTML version deleted]]

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] data.frame subsetting

2003-07-24 Thread Duncan Murdoch
On Thu, 24 Jul 2003 16:27:28 +0200, Dirk Repsilber
[EMAIL PROTECTED] wrote :

Hi,

is there advice how to subset a data.frame, where until R version 1.7.0 
it was possible to write

  data[[subset]]

which meant the same as

  data$subset

(data is a data.frame). From 1.7.1 on this does not seem to work longer. 
Could there be a bug in downwards compatibility?

What are you trying to achieve?  The notation you give still works if
subset is one of the column names; I don't think it ever worked if
subset was a logical vector, like its name would suggest.

Duncan Murdoch

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] Problem w/ source

2003-07-24 Thread Duncan Murdoch
On Thu, 24 Jul 2003 10:42:05 -0400, Peter Muhlberger
[EMAIL PROTECTED] wrote :

I'm trying to use the source command to run commands from a file.  For
instance:  source(do.R), where do.R is a file in the same directory in
which I am running R.

The contents of do.R are:

ls()
print(hello)
sum(y1)
mean(y1)


After  source(do.R), all I see is:

 source(do.R)
[1] hello


I'm using the X11 version of R for Mac OS X (downloadable binary).  Does
anyone know how to get source to work?

You probably want 

source(do.R, echo = TRUE)

or maybe not; see ?source.

Duncan Murdoch

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] trellis plot question

2003-07-24 Thread Douglas Bates
Suzette Blanchard [EMAIL PROTECTED] writes:

 Does anyone know how to get an id number in the little header 
 above each individual plot within a trellis plot?  The default
 seems to be to print the word id and add a line indicating on
 a linear scale where the current id sits.

See the description of the strip argument in ?xyplot and the
documentation for strip.default.  There are currently 6 different
styles available or you can add your own.

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] Problem w/ source

2003-07-24 Thread Douglas Bates
Well, we feel that source does work the way that it is documented to
work.  Please read the documentation and notice that the entire file
is evaluated as one step in the read-eval-print loop.  If you want to
print the results of individual function calls you will need to change
your script to

print(ls())
print(hello)
print(sum(y1))
print(mean(y1))

Peter Muhlberger [EMAIL PROTECTED] writes:

 I'm trying to use the source command to run commands from a file.  For
 instance:  source(do.R), where do.R is a file in the same directory in
 which I am running R.
 
 The contents of do.R are:
 
 ls()
 print(hello)
 sum(y1)
 mean(y1)
 
 
 After  source(do.R), all I see is:
 
  source(do.R)
 [1] hello
 
 
 I'm using the X11 version of R for Mac OS X (downloadable binary).  Does
 anyone know how to get source to work?
 
 Thanks!
 
 Peter
 
 __
 [EMAIL PROTECTED] mailing list
 https://www.stat.math.ethz.ch/mailman/listinfo/r-help

-- 
Douglas Bates[EMAIL PROTECTED]
Statistics Department608/262-2598
University of Wisconsin - Madisonhttp://www.stat.wisc.edu/~bates/

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] Plotting math functions

2003-07-24 Thread Duncan Murdoch
On Thu, 24 Jul 2003 16:55:55 +0200, Jonck van der Kogel
[EMAIL PROTECTED] wrote :

Hi all,
I was wondering whether it is possible to plot math functions, for 
example sin, cos or a Gaussian type function, in R, and if so, how to 
do it. I have been searching through the archives and the R manual but 
had no luck in finding any hints on how to go about this.
Any help is much appreciated!

You can use

  plot(sin, from=-10, to=10)

This calls plot.function; look at ?plot.function to read about the
options.

Duncan Murdoch

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] Integer programming in R

2003-07-24 Thread Robin Naidoo
Dear all,

I am a relative newcomer to the R language, and am sussing out 
the possibilities of using R to do integer programming (which I am 
also new to).  Is there something along the lines of the NUOPT S-
PLUS package that is available, or on the way, for R?  Are there 
other options for integer programming in R?  

Thanks very much in advance,

Robin Naidoo
University of Alberta
Edmonton, AB, Canada

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] Problem w/ source

2003-07-24 Thread Peter Muhlberger
Thanks to everyone for their suggestions on getting source to print!  It
seems not everyone was aware of a couple options that gets source to print
out everything.  I'm now using the following command:

source(do.R, print.eval=TRUE, echo=TRUE)

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] scatterplot smoothing using gam

2003-07-24 Thread Tony Long
All:

	I am trying to use gam in a scatterplot smoothing problem. 
The data being smoothed have greater 1000 observation and have 
multiple humps.  I can smooth the data fine using a function 
something like:

out - ksmooth(x,y,normal,bandwidth=0.25)
plot(x,out$y,type=l)
The problem is when I try to fit the same data using gam

out - predict.gam(gam(y~s(x)),se=TRUE)
plot(x,out$fit,type=l)
I only seem to get fits that would correspond to big bandwidths 
using ksmooth, and straight lines are always fit to the data.  I do 
not appear to appreciate how to control bandwidth using gam.  As 
even if I apply something like the gam model above to the smoothed 
out$y generated using ksmooth it tends to flatten out the smoothing 
curve.
--
###

Tony Long

Ecology and Evolutionary Biology
Steinhaus Hall
University of California at Irvine
Irvine, CA
92697-2525
Tel:  (949) 824-2562   (office)
Tel:  (949) 824-5994   (lab)
Fax: (949) 824-2181
email:  [EMAIL PROTECTED]
http://hjmuller.bio.uci.edu/~labhome/
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] wireframe: how to remove the frame around my plot?

2003-07-24 Thread Alexis J. Diamond
Hi,

I've got a wireframe 3D surface plot, but I don't want a frame around it.
Is there any way to remove the frame, or (worst case)
change the color of the frame to the background color (which looks like
grey).

I'm using ver 1.7.1

I've tried frame.plot = F, but that doesn't seem to work for 'wireframe'.

Many thanks,

Alexis Diamond

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] data.frame subsetting

2003-07-24 Thread Douglas Bates
Still works for me in both 1.7.1 and 1.8.0 (in development)

 data(women)
 women[[height]]
 [1] 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
 women$height
 [1] 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72

Can you provide an example of how it is failing for you?


Dirk Repsilber [EMAIL PROTECTED] writes:

 Hi,
 
 is there advice how to subset a data.frame, where until R version
 1.7.0 it was possible to write
 
 
   data[[subset]]
 
 which meant the same as
 
   data$subset
 
 (data is a data.frame). From 1.7.1 on this does not seem to work
 longer. Could there be a bug in downwards compatibility?
 
 
 sincerely yours
 
 Dirk
 
 __
 [EMAIL PROTECTED] mailing list
 https://www.stat.math.ethz.ch/mailman/listinfo/r-help

-- 
Douglas Bates[EMAIL PROTECTED]
Statistics Department608/262-2598
University of Wisconsin - Madisonhttp://www.stat.wisc.edu/~bates/

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] wireframe: how to remove the frame around my plot?

2003-07-24 Thread Jerome Asselin

You can specify some options in par.box. Use col=NA to make the frame 
transparent. See example below (which was modified from the help file).
See also the scales parameter if you want to remove the arrows as well.

Cheers,
Jerome

 library(lattice)
 x - seq(-pi, pi, len = 20)
 y - seq(-pi, pi, len = 20)
 g - expand.grid(x = x, y = y)
 g$z - sin(sqrt(g$x^2 + g$y^2))
 wireframe(z ~ x * y, g, drape = TRUE,
   perspective = FALSE,
   aspect = c(3,1), colorkey = FALSE,
   par.box = list(col=NA))



On July 24, 2003 12:44 pm, Alexis J. Diamond wrote:
 Hi,

 I've got a wireframe 3D surface plot, but I don't want a frame around
 it. Is there any way to remove the frame, or (worst case)
 change the color of the frame to the background color (which looks like
 grey).

 I'm using ver 1.7.1

 I've tried frame.plot = F, but that doesn't seem to work for
 'wireframe'.

 Many thanks,

 Alexis Diamond

 __
 [EMAIL PROTECTED] mailing list
 https://www.stat.math.ethz.ch/mailman/listinfo/r-help

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] wireframe: how to remove the frame around my plot?

2003-07-24 Thread Uwe Ligges
Jerome Asselin wrote:
 
 You can specify some options in par.box. Use col=NA to make the frame
 transparent. See example below (which was modified from the help file).
 See also the scales parameter if you want to remove the arrows as well.
 
 Cheers,
 Jerome
 
  library(lattice)
  x - seq(-pi, pi, len = 20)
  y - seq(-pi, pi, len = 20)
  g - expand.grid(x = x, y = y)
  g$z - sin(sqrt(g$x^2 + g$y^2))
  wireframe(z ~ x * y, g, drape = TRUE,
perspective = FALSE,
aspect = c(3,1), colorkey = FALSE,
par.box = list(col=NA))

Which doesn't work on device 
 trellis.device(windows)
but works well on, e.g., 
 trellis.device(postscript)

Deepayan, since I don't have the time to check that right now: Is this
bug known? Is this a bug in R, grid or lattice?

Uwe


 On July 24, 2003 12:44 pm, Alexis J. Diamond wrote:
  Hi,
 
  I've got a wireframe 3D surface plot, but I don't want a frame around
  it. Is there any way to remove the frame, or (worst case)
  change the color of the frame to the background color (which looks like
  grey).
 
  I'm using ver 1.7.1
 
  I've tried frame.plot = F, but that doesn't seem to work for
  'wireframe'.
 
  Many thanks,
 
  Alexis Diamond
 
  __
  [EMAIL PROTECTED] mailing list
  https://www.stat.math.ethz.ch/mailman/listinfo/r-help
 
 __
 [EMAIL PROTECTED] mailing list
 https://www.stat.math.ethz.ch/mailman/listinfo/r-help

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] wireframe: how to remove the frame around my plot?

2003-07-24 Thread Alexis J. Diamond
hi jerome,

thank you for your quick reply.
your advice removes the 3D box in which the 3D plot is generated,
but i like THAT box.  (sorry for being unclear earlier)

what i want to do is remove the 2D frame (a box of thin black lines) that
circumscribes all of my plot area.  any ideas?

thanks again,

alexis

On Thu, 24 Jul 2003, Jerome Asselin wrote:


 You can specify some options in par.box. Use col=NA to make the frame
 transparent. See example below (which was modified from the help file).
 See also the scales parameter if you want to remove the arrows as well.

 Cheers,
 Jerome

  library(lattice)
  x - seq(-pi, pi, len = 20)
  y - seq(-pi, pi, len = 20)
  g - expand.grid(x = x, y = y)
  g$z - sin(sqrt(g$x^2 + g$y^2))
  wireframe(z ~ x * y, g, drape = TRUE,
perspective = FALSE,
aspect = c(3,1), colorkey = FALSE,
par.box = list(col=NA))



 On July 24, 2003 12:44 pm, Alexis J. Diamond wrote:
  Hi,
 
  I've got a wireframe 3D surface plot, but I don't want a frame around
  it. Is there any way to remove the frame, or (worst case)
  change the color of the frame to the background color (which looks like
  grey).
 
  I'm using ver 1.7.1
 
  I've tried frame.plot = F, but that doesn't seem to work for
  'wireframe'.
 
  Many thanks,
 
  Alexis Diamond
 
  __
  [EMAIL PROTECTED] mailing list
  https://www.stat.math.ethz.ch/mailman/listinfo/r-help


__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] wireframe: how to remove the frame around my plot?

2003-07-24 Thread Jake Bowers
Hi Y'all,

Alexis, I think Jerome's example works except for one change:

This one has a box but no wires:

wireframe(z ~ x * y, g, drape = TRUE,
perspective = FALSE,
aspect = c(3,1), colorkey = FALSE,
par.box = list(col=1),col=NA)

versus with no box and no wires:

wireframe(z ~ x * y, g, drape = TRUE,
   perspective = FALSE,
aspect = c(3,1), colorkey = FALSE,
par.box = list(col=NA),col=NA)

Hope this helps!

Jake
-
Jake Bowers
Dept of Political Science
University of Michigan

On Thu, 24 Jul 2003, Alexis J. Diamond wrote:

 hi jerome,

 thank you for your quick reply.
 your advice removes the 3D box in which the 3D plot is generated,
 but i like THAT box.  (sorry for being unclear earlier)

 what i want to do is remove the 2D frame (a box of thin black lines) that
 circumscribes all of my plot area.  any ideas?

 thanks again,

 alexis

 On Thu, 24 Jul 2003, Jerome Asselin wrote:

 
  You can specify some options in par.box. Use col=NA to make the frame
  transparent. See example below (which was modified from the help file).
  See also the scales parameter if you want to remove the arrows as well.
 
  Cheers,
  Jerome
 
   library(lattice)
   x - seq(-pi, pi, len = 20)
   y - seq(-pi, pi, len = 20)
   g - expand.grid(x = x, y = y)
   g$z - sin(sqrt(g$x^2 + g$y^2))
   wireframe(z ~ x * y, g, drape = TRUE,
 perspective = FALSE,
 aspect = c(3,1), colorkey = FALSE,
 par.box = list(col=NA))
 
 
 
  On July 24, 2003 12:44 pm, Alexis J. Diamond wrote:
   Hi,
  
   I've got a wireframe 3D surface plot, but I don't want a frame around
   it. Is there any way to remove the frame, or (worst case)
   change the color of the frame to the background color (which looks like
   grey).
  
   I'm using ver 1.7.1
  
   I've tried frame.plot = F, but that doesn't seem to work for
   'wireframe'.
  
   Many thanks,
  
   Alexis Diamond
  
   __
   [EMAIL PROTECTED] mailing list
   https://www.stat.math.ethz.ch/mailman/listinfo/r-help
 

 __
 [EMAIL PROTECTED] mailing list
 https://www.stat.math.ethz.ch/mailman/listinfo/r-help


__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] postscript device: pch='.' size?

2003-07-24 Thread ivo welch
hi ladies and gents:

I am using R 1.7.0.  Alas, the pch=. in the postscript device is too 
large for me, but apparently not scaleable via cex.  Maybe a bug, though 
I read a complaing about this in the list archives from 1999, and given 
that it is still around, maybe it is a feature.

Now, I would be happy with pch=o and cex=0.05, but for some strange 
reason, the resulting .eps file then becomes 3 times the size (200K, 
rather than 70K).  For web-downloadable files, this can become painful.

Are there any remedies?

Regards,

/iaw

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] wireframe: how to remove the frame around my plot?

2003-07-24 Thread Alexis J. Diamond
hi jake,

thanks for your e-mail.

what i am actually trying to do is remove the 'picture frame' 2D box (the
super-frame) that circumscribes the entire figure-- for example, the left
vertical side of this box i'm concerned about is to the left of the 'z' axis label.
i hope i'm finally making my query clear.

both of your examples below retain this pictureframe box (jerome's
examples do too), when the output is viewed as a .eps file in ghostcript
viewer, so i am still stuck,
unfortunately.

there's got to be a parameter that modifies this picureframe box's color
and style, right?

thanks again,

alexis


On Thu, 24 Jul 2003, Jake Bowers wrote:

 Hi Y'all,

 Alexis, I think Jerome's example works except for one change:

 This one has a box but no wires:

 wireframe(z ~ x * y, g, drape = TRUE,
 perspective = FALSE,
 aspect = c(3,1), colorkey = FALSE,
 par.box = list(col=1),col=NA)

 versus with no box and no wires:

 wireframe(z ~ x * y, g, drape = TRUE,
perspective = FALSE,
 aspect = c(3,1), colorkey = FALSE,
 par.box = list(col=NA),col=NA)

 Hope this helps!

 Jake
 -
 Jake Bowers
 Dept of Political Science
 University of Michigan

 On Thu, 24 Jul 2003, Alexis J. Diamond wrote:

  hi jerome,
 
  thank you for your quick reply.
  your advice removes the 3D box in which the 3D plot is generated,
  but i like THAT box.  (sorry for being unclear earlier)
 
  what i want to do is remove the 2D frame (a box of thin black lines) that
  circumscribes all of my plot area.  any ideas?
 
  thanks again,
 
  alexis
 
  On Thu, 24 Jul 2003, Jerome Asselin wrote:
 
  
   You can specify some options in par.box. Use col=NA to make the frame
   transparent. See example below (which was modified from the help file).
   See also the scales parameter if you want to remove the arrows as well.
  
   Cheers,
   Jerome
  
library(lattice)
x - seq(-pi, pi, len = 20)
y - seq(-pi, pi, len = 20)
g - expand.grid(x = x, y = y)
g$z - sin(sqrt(g$x^2 + g$y^2))
wireframe(z ~ x * y, g, drape = TRUE,
  perspective = FALSE,
  aspect = c(3,1), colorkey = FALSE,
  par.box = list(col=NA))
  
  
  
   On July 24, 2003 12:44 pm, Alexis J. Diamond wrote:
Hi,
   
I've got a wireframe 3D surface plot, but I don't want a frame around
it. Is there any way to remove the frame, or (worst case)
change the color of the frame to the background color (which looks like
grey).
   
I'm using ver 1.7.1
   
I've tried frame.plot = F, but that doesn't seem to work for
'wireframe'.
   
Many thanks,
   
Alexis Diamond
   
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
  
 
  __
  [EMAIL PROTECTED] mailing list
  https://www.stat.math.ethz.ch/mailman/listinfo/r-help
 


__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] wireframe: how to remove the frame around my plot?

2003-07-24 Thread Jerome Asselin


Finally, I think this works. The function trellis.par.get() contains all 
default values of the parameters. I had to reset the option axis.line as 
below. The bounding (square) box is made transparent. See 
trellis.par.get() for the list of all default parameter values.

Cheers,
Jerome

 library(lattice)
 x - seq(-pi, pi, len = 20)
 y - seq(-pi, pi, len = 20)
 g - expand.grid(x = x, y = y)
 g$z - sin(sqrt(g$x^2 + g$y^2))
 trellis.par.set(axis.line,list(col=NA,lty=1,lwd=1))
 wireframe(z ~ x * y, g, drape = TRUE,
   perspective = FALSE,
   aspect = c(3,1), colorkey = FALSE)


On July 24, 2003 02:41 pm, Alexis J. Diamond wrote:
 hi jake,

 thanks for your e-mail.

 what i am actually trying to do is remove the 'picture frame' 2D box
 (the super-frame) that circumscribes the entire figure-- for example,
 the left vertical side of this box i'm concerned about is to the left of
 the 'z' axis label. i hope i'm finally making my query clear.

 both of your examples below retain this pictureframe box (jerome's
 examples do too), when the output is viewed as a .eps file in ghostcript
 viewer, so i am still stuck,
 unfortunately.

 there's got to be a parameter that modifies this picureframe box's color
 and style, right?

 thanks again,

 alexis

 On Thu, 24 Jul 2003, Jake Bowers wrote:
  Hi Y'all,
 
  Alexis, I think Jerome's example works except for one change:
 
  This one has a box but no wires:
 
  wireframe(z ~ x * y, g, drape = TRUE,
  perspective = FALSE,
  aspect = c(3,1), colorkey = FALSE,
  par.box = list(col=1),col=NA)
 
  versus with no box and no wires:
 
  wireframe(z ~ x * y, g, drape = TRUE,
 perspective = FALSE,
  aspect = c(3,1), colorkey = FALSE,
  par.box = list(col=NA),col=NA)
 
  Hope this helps!
 
  Jake
  -
  Jake Bowers
  Dept of Political Science
  University of Michigan
 
  On Thu, 24 Jul 2003, Alexis J. Diamond wrote:
   hi jerome,
  
   thank you for your quick reply.
   your advice removes the 3D box in which the 3D plot is generated,
   but i like THAT box.  (sorry for being unclear earlier)
  
   what i want to do is remove the 2D frame (a box of thin black lines)
   that circumscribes all of my plot area.  any ideas?
  
   thanks again,
  
   alexis
  
   On Thu, 24 Jul 2003, Jerome Asselin wrote:
You can specify some options in par.box. Use col=NA to make the
frame transparent. See example below (which was modified from the
help file). See also the scales parameter if you want to remove
the arrows as well.
   
Cheers,
Jerome
   
 library(lattice)
 x - seq(-pi, pi, len = 20)
 y - seq(-pi, pi, len = 20)
 g - expand.grid(x = x, y = y)
 g$z - sin(sqrt(g$x^2 + g$y^2))
 wireframe(z ~ x * y, g, drape = TRUE,
   perspective = FALSE,
   aspect = c(3,1), colorkey = FALSE,
   par.box = list(col=NA))
   
On July 24, 2003 12:44 pm, Alexis J. Diamond wrote:
 Hi,

 I've got a wireframe 3D surface plot, but I don't want a frame
 around it. Is there any way to remove the frame, or (worst case)
 change the color of the frame to the background color (which
 looks like grey).

 I'm using ver 1.7.1

 I've tried frame.plot = F, but that doesn't seem to work for
 'wireframe'.

 Many thanks,

 Alexis Diamond

 __
 [EMAIL PROTECTED] mailing list
 https://www.stat.math.ethz.ch/mailman/listinfo/r-help
  
   __
   [EMAIL PROTECTED] mailing list
   https://www.stat.math.ethz.ch/mailman/listinfo/r-help

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


RE: [R] Confidence Band for empirical distribution function

2003-07-24 Thread David Scott
On Thu, 24 Jul 2003, Hotz, T. wrote:

 Dear Kjetil,
 
 As I already mentioned, it appears that there isn't a function 
 available calculating the quantiles directly (at least, it doesn't appear
 in the C source of ctest). So as I already suggested, uniroot (or a similar
 C routine which calls the corresponding C code directly) is probably the 
 best you can do (apart from writing it completely yourself).
 
 I didn't program this using uniroot, but I'd certainly try the following 
 for speed-up:
 
 - For symmetry reasons, you only need to compute half of the quantiles.
 - The quantiles depend smoothly on the probabilities (of your reference
 distribution). Therefore, calculating only a few for probabilities 
 between 0 and 0.5, and using (e.g. linear) interpolation should be
 satisfying.
 

There is an example of this in my package HyperbolicDist which has just 
appeared on CRAN. It is a little more sophisticated in that it fits a 
spline in preference to linear interpolation, before using uniroot.

Look at qhyperb if this is of interest.

David Scott



_
David Scott Department of Statistics, Tamaki Campus
The University of Auckland, PB 92019
AucklandNEW ZEALAND
Phone: +64 9 373 7599 ext 86830 Fax: +64 9 373 7000
Email:  [EMAIL PROTECTED] 


Graduate Officer, Department of Statistics

Webmaster, New Zealand Statistical Association:
http://www.stat.auckland.ac.nz/nzsa/

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] inverse prediction and Poisson regression

2003-07-24 Thread Vincent Philion
Hello to all, I'm a biologist trying to tackle a fish (Poisson Regression) which is 
just too big for my modest understanding of stats!!!

Here goes...

I want to find good literature or proper mathematical procedure to calculate a 
confidence interval for an inverse prediction of a Poisson regression using R. 

I'm currently trying to analyse a dose-response experiment. 

I want to calculate the dose (X) for 50% inhibition of a biological response (Y). My 
response is a count data that fits a Poisson distribution perfectly. 

I could make my life easy and calculate: dose response/control response = % of total 
response... and then use logistic regression, but somehow, that doesn't sound right.
 
Should I just stick to logistic regression and go on with my life? Can I be cured of 
this paranoia?
;-)

I thought a Poisson regression would be more appropriate, but I don't know how to 
properly calculate the dose equivalent to 50% inhibition. i/e confidence intervals, 
etc on the X = dose. Basically an inverse prediction problem.

By the way, my data is graphically linear for Log(Y) = log(X) where Y is counts and 
X is dose.

I use a Poisson regression to fit my dose-response experiment by EXCLUDING the 
response for dose = 0, because of log(0)

Under R = 

   glm.dose - glm(response[-1] ~ log(dose[-1]),family=poisson())

(that's why you see the dose[-1] term. The first dose in the dose vector is 0. 

This is really a nice fit. I can obtain a nice slope (B) and intercept (A):

log(Y) = B log(x) + A

I do have a biological value for dose = 0 from my control. i/e Ymax = some number 
with a Poisson error again

So, what I want is EC50x :

Y/Ymax = 0.5 = exp(B log(EC50x) + A) / Ymax

exp((log(0.5) + Log(Ymax)) - A)/B) = EC50x

That's all fine, except I don't have a clue on how to calculate the confidence 
intervals of EC50x or even if I can model this inverse prediction with a Poisson 
regression. In OLS linear regression, fitting X based on Y is not a good idea because 
of the way OLS calculates the slope and intercept. Is the same problem found in 
GLM/Poisson regression? Moreover, I also have a Poisson error on Ymax that I would 
have to consider, right?

Help


-- 
Vincent Philion, M.Sc. agr.
Phytopathologiste
Institut de Recherche et de Développement en Agroenvironnement (IRDA)
3300 Sicotte, St-Hyacinthe
Québec
J2S 7B8

téléphone: 450-778-6522 poste 233
courriel: [EMAIL PROTECTED]
Site internet : www.irda.qc.ca

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] R-WinEdt problems

2003-07-24 Thread JEFFREY C JORGENSEN
Hello,


I've done most all the various steps outlined in a
recent posting to the mailing list archives
(and in the help files) to load and run R-WinEdt.  I
can get it to run fine but I am not successful in
getting it to interface with RGui (1.6.2, not
minimized).  I try to use the R-line, R-source,
R-paste buttons with no success.  [All the necessary
*.edt files appear to be in the proper directories.]

I've done everything except modify the rprofile or
the options().  Is that necessary, and if so how
exactly do I do that?  And, if I do modify them how
do I restore them back to their default settings?

Any help would be much appreciated.

Thanks,
Jeff Jorgensen
[EMAIL PROTECTED]

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] contourplot: how to ensure all (or certain) 'cuts' get labelled

2003-07-24 Thread Alexis J. Diamond
hi all,

contourplot generates a nice plot, but there are cut lines that don't have
labels in my figure.
i think this is because there's a high ridge stretching
north-west/south-east entirely across the plot, diagonal-to-diagonal,
and contourplot only wants to label each elevation-level only once, which
means only lines in the upper-right quadrant got labelled.

is there some way to *identify* and label a cutpoint that has no label,
or to force contourplot to label each (or a particular) cutpoint?

if i knew what the label should be on a given label-less cutpoint, i could
probably insert it in as text myself.  but i don't even know what it should be.

by the way, does anyone know why i got only 5 cuts, when i specified
cuts = 10?

thanks,

alexis
ps-- i am open to using *contour* instead of *contourplot* if this gives
me more control over the output.

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] R-WinEdt problems

2003-07-24 Thread TyagiAnupam
Right click on your WinEdt icon and go to Properties menu-item. In the 
Target box look for something like, 
[PathToWinEdt]\WinEdt\WinEdt.exe -C=R-WinEdt -e=r.ini

If you don't find something like this, make the change and try it.

* It may be better to have a new icon for R-WinEdt on your desktop with the 
above modified Target, and use the existing icon for other work. Not sure how 
to solve the switching problem, given that there is a R specific 
initialization file being used.

---Anupam.

In a message dated 7/24/03 6:15:46 PM Eastern Daylight Time, 
[EMAIL PROTECTED] writes:

 Hello,
 
 
 I've done most all the various steps outlined in a
 recent posting to the mailing list archives
 (and in the help files) to load and run R-WinEdt.  I
 can get it to run fine but I am not successful in
 getting it to interface with RGui (1.6.2, not
 minimized).  I try to use the R-line, R-source,
 R-paste buttons with no success.  [All the necessary
 *.edt files appear to be in the proper directories.]
 
 I've done everything except modify the rprofile or
 the options().  Is that necessary, and if so how
 exactly do I do that?  And, if I do modify them how
 do I restore them back to their default settings?
 
 Any help would be much appreciated.
 
 Thanks,
 Jeff Jorgensen
 [EMAIL PROTECTED]
 
 __
 [EMAIL PROTECTED] mailing list
 https://www.stat.math.ethz.ch/mailman/listinfo/r-help
 


[[alternative HTML version deleted]]

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] Plotting Vector Fields

2003-07-24 Thread bb2
Dear R List,

Is there a function to plot vector fields in R?

I'm looking for something similar to PlotVectorField in Mathematica 
(see below), e.g. given functions f(x) and f(y), I would like to plot 
the resulting field of vectors (f(x),f(y)) over some range of x and y.

PlotVectorField[{f(x), f(y)}, {x, xmin, xmax}, {y, ymin, ymax}]



Thanks for your help,
Brian
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] inverse prediction and Poisson regression

2003-07-24 Thread Spencer Graves
	  1.  If you provide a toy data set with, e.g., 5 observations, to 
accompany your example, it would be much easier for people to try out 
ideas and then give you a more solid response.

	  2.  Have you tried something like log(dose+0.5) or I(log(dose+0.5)) 
in your model statement in conjunction with predict or predict.glm 
on the output from glm?

hope this helps.  spencer graves

Vincent Philion wrote:
Hello to all, I'm a biologist trying to tackle a fish 
(Poisson Regression) which is just too big for my modest
understanding of stats!!!
Here goes...

I want to find good literature or proper mathematical 
procedure to calculate a confidence interval for an
inverse prediction of a Poisson regression using R.
I'm currently trying to analyse a dose-response
experiment.
I want to calculate the dose (X) for 50% inhibition 
of a biological response (Y). My response is a count
data that fits a Poisson distribution perfectly.
I could make my life easy and calculate: dose 
response/control response = % of total response...
and then use logistic regression, but somehow, that
doesn't sound right.
 
Should I just stick to logistic regression and go
on with my life? Can I be cured of this paranoia?
;-)

I thought a Poisson regression would be more 
appropriate, but I don't know how to properly
calculate the dose equivalent to 50% inhibition.
i/e confidence intervals, etc on the X = dose.
Basically an inverse prediction problem.
By the way, my data is graphically linear for 
Log(Y) = log(X) where Y is counts and X is dose.
I use a Poisson regression to fit my dose-response 
experiment by EXCLUDING the response for dose = 0,
because of log(0)
Under R = 


	glm.dose - glm(response[-1] ~ log(dose[-1]),family=poisson())


(that's why you see the dose[-1] term. The 
first dose in the dose vector is 0.
This is really a nice fit. I can obtain a nice 
slope (B) and intercept (A):
log(Y) = B log(x) + A

I do have a biological value for dose = 0 from 
my control. i/e Ymax = some number with a Poisson
error again
So, what I want is EC50x :

Y/Ymax = 0.5 = exp(B log(EC50x) + A) / Ymax

exp((log(0.5) + Log(Ymax)) - A)/B) = EC50x

That's all fine, except I don't have a clue on how 
to calculate the confidence intervals of EC50x or even
if I can model this inverse prediction with a Poisson
regression. In OLS linear regression, fitting X based
on Y is not a good idea because of the way OLS calculates
the slope and intercept. Is the same problem found in
GLM/Poisson regression? Moreover, I also have a Poisson
error on Ymax that I would have to consider, right?
Help


__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] animal model in R

2003-07-24 Thread David Duffy
If your datasets are small, then it is not difficult to roll your own
using optim().  If you look at
http://www.qimr.edu.au/davidD/sib-pair.R
you will find such a routine at lines 1511-1562.  This calls
kinship.rel() that produces NRM etc.

-- 
| David Duffy (MBBS PhD) ,-_|\
| email: [EMAIL PROTECTED]  ph: INT+61+7+3362-0217 fax: -0101  / *
| Epidemiology Unit, Queensland Institute of Medical Research   \_,-._/
| 300 Herston Rd, Brisbane, Queensland 4029, Australia  GPG 4D0B994A v

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] Memory explosion, plotting nmle grouped data object

2003-07-24 Thread Nicholas Lewin-Koh
Hi
I am using R 1.7.1 on RH linux 9.0 
 sum(unlist(lapply(ls(),function(x)object.size(get(x)/1024^2
[1] 2.424263

so I am not using much memory (I have a gig of ram on my machine)
now in nlme

 gtest-groupedData(log(X8)~Time|sub,all[,c(names(all)[1:9],X8)],outer=~A*B)
 object.size(gtest)/1024
[1] 59.98438

 plot(gtest,outer=~Dose*chem,key=FALSE,asp=.5)

Plotting takes forever and from top while it is running

5663 wf00223   15   0 1151M 546M  1780 R 6.1 54.2   3:19   0 R.bin

Any Ideas why R is using so much memory?

Thanks
Nicholas

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] Integer programming in R

2003-07-24 Thread apjaworski

Robin,

This is not a direct answer to your question, but there exists a pretty
good linear, mixted and integer programming package called lp_solve.  I
have used it successfully  on a couple of projects.  As far as I know it is
in the public domain and there is source code available.  There is also a
precompiled version available for Windows Visual Basic environment
containing a precompiled DLL and an interface module defining VB function
calls to the DLL.  I think, that having all that it should be possible to
get something going in R, at least in the Windows environment.

Hope this helps,

Andy

__
Andy Jaworski
Engineering Systems Technology Center
3M Center, 518-1-01
St. Paul, MN 55144-1000
-
E-mail: [EMAIL PROTECTED]
Tel:  (651) 733-6092
Fax:  (651) 736-3122


|-+
| |   Robin Naidoo   |
| |   [EMAIL PROTECTED]|
| |   Sent by: |
| |   [EMAIL PROTECTED]|
| |   ath.ethz.ch  |
| ||
| ||
| |   07/24/2003 12:18 |
| ||
|-+
  
-|
  |
 |
  |  To:   [EMAIL PROTECTED]   
  |
  |  cc:   
 |
  |  Subject:  [R] Integer programming in R
 |
  
-|




Dear all,

I am a relative newcomer to the R language, and am sussing out
the possibilities of using R to do integer programming (which I am
also new to).  Is there something along the lines of the NUOPT S-
PLUS package that is available, or on the way, for R?  Are there
other options for integer programming in R?

Thanks very much in advance,

Robin Naidoo
University of Alberta
Edmonton, AB, Canada

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


[R] Multiple expressions in system.time()?

2003-07-24 Thread Robert Keefe

Hi All,

Is it possible for system.time() to measure the time
it takes for a machine to evaluate more than one R
expression?

For example,

# This I can do:
 system.time(x - rnorm(10))
[1] 0.07 0.00 0.13 0.00 0.00

# But this I can't:
 system.time(x - rnorm(10); new - sample(x, 10, replace=T))
Error: syntax error

# Nor this:
 system.time(x - rnorm(10)
+ new - sample(x, 10, replace=T)
Error: syntax error

I'm trying to compare two fairly large code chunks,
so executing system.time() individually for each expression
and then summing the results seems suboptimal.

Have I missed something simple?

Thanks in advance for any suggestions-

Rob


version:

platform i386-pc-linux-gnu
arch i386
os   linux-gnu
system   i386, linux-gnu
status
major1
minor7.1
year 2003
month06
day  16
language R
_

Rob Keefe Lab: (208) 885-5165
M.S. student  Home: (208) 882-9749
University of Idaho

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help


Re: [R] Multiple expressions in system.time()?

2003-07-24 Thread Dirk Eddelbuettel
On Thu, Jul 24, 2003 at 07:10:27PM -0700, Robert Keefe wrote:
 # This I can do:
  system.time(x - rnorm(10))
 [1] 0.07 0.00 0.13 0.00 0.00
 
 # But this I can't:
  system.time(x - rnorm(10); new - sample(x, 10, replace=T))
 Error: syntax error

Just use curly braces:

 system.time({x - rnorm(10); new - sample(x, 10, replace=T)})
[1] 0.11 0.00 0.11 0.00 0.00

 Have I missed something simple?

See above. Another related way is to define a function; you could even use a
'throw-away anonymous' function [1].

Lastly, you probably also want to learn about profiling your code. There is
an introductory article in one of the R News issues.

Regards, Dirk

-- 
Those are my principles, and if you don't like them... well, I have others.
-- Groucho Marx

__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help