Re: [R] How to plot two variables using a secondary Y axis

2007-07-11 Thread hadley wickham
On 7/10/07, Felipe Carrillo [EMAIL PROTECTED] wrote:
   Date  Fo  Co6/27/2007  57.1  13.96/28/2007  57.7  14.3
 6/29/2007  57.8  14.36/30/2007  57  13.97/1/2007  57.1  13.9
 7/2/2007  57.2  14.07/3/2007  57.3  14.17/4/2007  57.6  14.2
 7/5/2007  58  14.47/6/2007  58.1  14.57/7/2007  58.2  14.6
 7/8/2007  58.4  14.77/9/200758.7
 14.8

   Hello all:
   I am a newbie to R, and I was wondering how can I plot the Temperature 
 values above using Lattice or ggplot2 code. I want Date(X axis), Degrees F(Y 
 axis) and Degrees C( on a secondary Y axis).

Hi Felipe,

It's not currently possible with ggplot2, but it is something on my to do list.

Hadley

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


[R] Window Version for permtest

2007-07-11 Thread amna khan
Hi Sir

There is no Window Binary versin of package permtest.Please provide
information in this regard.

Thank you

-- 
AMINA SHAHZADI
Department of Statistics
GC University Lahore, Pakistan.
Email:
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]

[[alternative HTML version deleted]]

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Window Version for permtest

2007-07-11 Thread Prof Brian Ripley
On Wed, 11 Jul 2007, amna khan wrote:

 Hi Sir

 There is no Window Binary versin of package permtest.Please provide
 information in this regard.


See

http://cran.r-project.org/bin/windows/contrib/2.5/check/permtest-check.log

[Sending this once was quite sufficient.]

-- 
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

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


[R] Plot SpatialLinesDataFrame with xlim ylim

2007-07-11 Thread Edzer J. Pebesma
Michael,

The plot method for SpatialLinesDataFrame objects resides in package sp, 
and questions regarding it are easier noticed on the r-sig-geo mailing 
list.

The reason why they are plotted with aspect ratio 1 is that they are 
assumed to be spatial (geographical) data, and assume that 1 m north 
equals 1 m west -- think of a map. The exception is when the projection 
argument is set to longlat data (i.e. decimal degrees North/East), where 
the aspect ratio is computed differently, such that the argument above 
more or less holds.

You should be able to override the default aspect setting by explicitly 
passing the e.g. asp=0.5 argument to plot.

Here's the comment in the documentation of plot for Spatial objects 
(such as SpatialLinesDataFrame):

The default aspect for map plots is 1; if however data are not projected 
(coordinates are longlat), the aspect is by default set to 1/cos(My * 
pi)/180) with My the y coordinate of the middle of the map (the mean of 
ylim, which defaults to the y range of bounding box).

The argument |setParUsrBB| may be used to pass the logical value |TRUE| 
to functions within |plot.Spatial|. When set to |TRUE|, par(“usr”) will 
be overwritten with |c(xlim, ylim)|, which defaults to the bounding box 
of the spatial object. This is only needed in the particular context of 
graphic output to a specified device with given width and height, to be 
matched to the spatial object, when using par(“xaxs”) and par(“yaxs”) in 
addition to |par(mar=c(0,0,0,0))|.
--

Edzer

I'm running windows xp, R 2.3.1 with maptools 0.6-6, I guess. 
When plotting from a large SpatialLinesDataFrame and using xlim  ylim to 
reduce the area, the plot axes automatically have the same scale size, even if 
xlim and ylim ranges differ.  
E.g.:
tmp - readShapeLines(filepath)
plot(tmp,xlim=c(-126,-119),ylim=c(50,51))

The y-axis range is actually 47-54, same range as the x-axis.  What am I doing 
wrong?  Should I be using a different object for simple coastline  river data?
Thanks in advance!
Michael

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


[R] Improved Windows Vista compatibility

2007-07-11 Thread Prof Brian Ripley
Duncan Murdoch and I have been working on Vista compatibility.

The first build of R-2.5.1-win32.exe was built with a version of the 
installer that had some compatibility issues, and it has been rebuilt 
under the latest version.  What now happens is that if you want to install 
R in an adminstrative area you need to select 'Run as Administrator' when 
running the installer: otherwise the default installation directory 
offered will be in your user area (e.g. c:/Users/ripley/Documents).

The Tcl support files came with obsolete Winhelp 4 .hlp files that are not 
readable under Vista, and .chm help has been added.  (As from the next 
release .hlp will be dropped.)

Rtools.exe has also been rebuilt with newer versions of the tools that 
work on Vista.  There is still a compiler path issue, and you need to add

c:\Rtools\MinGW\libexec\gcc\mingw\3.4.5

(or similar) to your path.  When that is done I have successfully built 
and run R-patched and R-devel on 64-bit Vista.

-- 
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

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


[R] Installation on Leopard

2007-07-11 Thread Helin Gai
Hi all,
I'm wondering whether anyone has installed R on Mac OS X leopard with
success. I downloaded the latest version, but couldn't have it installed.
Any idea as to how I get around the problem? Thanks!

Sincerely,
Helin

-- 
Helin (Colin) Gai
Class of 2009, Duke University
Box 96332
Durham, NC 27708
Phone:  919-943-6302
helin.gai at gmail.com
hg9 at duke.edu

[[alternative HTML version deleted]]

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


[R] Making Gehan-Breslow test for Survival data

2007-07-11 Thread Cody Hamilton
Jose,

The Gehan-Breslow test provides a generalization of the Kruskal-Wallis test for 
censored data.  As an alternative, try using survdiff with rho=1.  This method 
uses weights w(ti) = S(ti) (where S is the Kaplan-Meier estimate of survival) 
which yields Fleming and Harrington's version of the Kruskal-Wallis test for 
censored data.  This test will give more weight to early differences in the 
hazards.

Regards,
   -Cody

Cody Hamilton
Edwards Lifesciences

Hi all,

The survivals functions can be tested by the Log-rank test and others, for
example the Gehan-Breslow. The graham breslow work with the alpha values.

But I don't know how is the Gehan-Breslow test with R. Somebody know a
type function?.. or other suggestions?  Any help will be really
appreciated

José Bustos
Marine Biologist
Master Apllied Stat Program
University of Concepción

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


[R] Previously saved workspace restored

2007-07-11 Thread Kristi Glover
hi there,
i an beginner of R. some one have sent me a file (extension is .Rdata).  i have 
 installed R in my computer and i just double clicked the data. then it 
automatically opened R programme and displayed that [previously saved workspace 
restored]. the following message was displayed. 
 
Type 'demo()' for some demos, 'help()' for on-line help, or'help.start()' for 
an HTML browser interface to help.Type 'q()' to quit R.
 
[Previously saved workspace restored]
 
but how  can I see the data (table) which is saved (in R format) in R?,  
 
i hope you will help me. 
 
Kristi Glover
 
 
 
 
_
Explore the seven wonders of the world

BRE
[[alternative HTML version deleted]]

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] ECDF, distribution of Pareto, distribution of Normal

2007-07-11 Thread livia

Thank you very much for your reply. I am afraid I have no idea what is wrong
with the pgpg function. The parameters are generated from pre-fitted GPD
distribution. 1.544 is the location parameter, 0.4373 is the scale parameter
and -0.2398 is the shape parameter.

Cound you please give me some hint?

Stefan Grosse-2 wrote:
 
 
 
  Original Message  
 Subject: [R] ECDF, distribution of Pareto, distribution of Normal
 From: livia [EMAIL PROTECTED]
 To: r-help@stat.math.ethz.ch
 Date: Tue Jul 10 2007 18:35:04 GMT+0200
 Hello all,

 I would like to plot the emperical CDF, normal CDF and pareto CDF in the
 same graph and I amusing the following codes. z is a vector and I just
 need the part when z between 1.6 and 3.

 plot(ecdf(z), do.points=FALSE, verticals=TRUE,
 xlim=c(1.6,3),ylim=c(1-sum(z1.6)/length(z), 1))

 x - seq(1.6, 3, 0.1)
 lines(x,pgpd(x, 1.544,0.4373,-0.2398), col=red)
   
 
 There is something wrong with your pgpd function, see ?pgpd for help and
 parameters... (I wonder how you got something plotted here...)
 
 
 y - seq(1.6, 3, 0.1)
 lines(y,pnorm(y, mean(z),sqrt(var(z))), col=blue)

 The emperical CDF and normal CDF look rather resonable, but the pareto
 CDF
 looks quite odd. I am not sure whether I plot the pareto CDF correctly
 e.g.
 in the right yaxs or any other mistake?

 At the same time, let t represents the vector whose values are larger
 than
 1.6(the part we want). If I implement the following codes and plot the
 emperical CDF and pareto CDF, the pareto CDF seems fit.

 plot(ecdf(t), do.points=FALSE, verticals=TRUE)
 x - seq(1.6, 3, 0.1)
 lines(x,pgpd(x, 1.544,0.4373,-0.2398), col=red)

 Could anyone give me some advice on this? Many thanks.

 
 __
 R-help@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
 and provide commented, minimal, self-contained, reproducible code.
 
 

-- 
View this message in context: 
http://www.nabble.com/ECDF%2C-distribution-of-Pareto%2C-distribution-of-Normal-tf4056943.html#a11536305
Sent from the R help mailing list archive at Nabble.com.

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] [R-sig-Geo] Plot SpatialLinesDataFrame with xlim ylim

2007-07-11 Thread Roger Bivand
On Wed, 11 Jul 2007, Edzer J. Pebesma wrote:

 Michael,

 The plot method for SpatialLinesDataFrame objects resides in package sp,
 and questions regarding it are easier noticed on the r-sig-geo mailing
 list.

 The reason why they are plotted with aspect ratio 1 is that they are
 assumed to be spatial (geographical) data, and assume that 1 m north
 equals 1 m west -- think of a map. The exception is when the projection
 argument is set to longlat data (i.e. decimal degrees North/East), where
 the aspect ratio is computed differently, such that the argument above
 more or less holds.

 You should be able to override the default aspect setting by explicitly
 passing the e.g. asp=0.5 argument to plot.

 Here's the comment in the documentation of plot for Spatial objects
 (such as SpatialLinesDataFrame):

 The default aspect for map plots is 1; if however data are not projected
 (coordinates are longlat), the aspect is by default set to 1/cos(My *
 pi)/180) with My the y coordinate of the middle of the map (the mean of
 ylim, which defaults to the y range of bounding box).

 The argument |setParUsrBB| may be used to pass the logical value |TRUE|
 to functions within |plot.Spatial|. When set to |TRUE|, par(?usr?) will
 be overwritten with |c(xlim, ylim)|, which defaults to the bounding box
 of the spatial object. This is only needed in the particular context of
 graphic output to a specified device with given width and height, to be
 matched to the spatial object, when using par(?xaxs?) and par(?yaxs?) in
 addition to |par(mar=c(0,0,0,0))|.


Yes, if you look at how the GE_SpatialGrid() function in maptools works - 
you'll see how it meddles with the actual regional extents and the device 
size. I think Michael's data should also have been set to longlat:

proj4string(tmp) - CRS(+proj=longlat)

The key is realising that the axes are driven by the device shape, not by 
the xlim/ylim as such, as Edzer says.

Roger


 --

 Edzer

 I'm running windows xp, R 2.3.1 with maptools 0.6-6, I guess.
 When plotting from a large SpatialLinesDataFrame and using xlim  ylim to 
 reduce the area, the plot axes automatically have the same scale size, even 
 if xlim and ylim ranges differ.
 E.g.:
 tmp - readShapeLines(filepath)
 plot(tmp,xlim=c(-126,-119),ylim=c(50,51))

 The y-axis range is actually 47-54, same range as the x-axis.  What am I 
 doing wrong?  Should I be using a different object for simple coastline  
 river data?
 Thanks in advance!
 Michael

 ___
 R-sig-Geo mailing list
 [EMAIL PROTECTED]
 https://stat.ethz.ch/mailman/listinfo/r-sig-geo


-- 
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: [EMAIL PROTECTED]

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] type III ANOVA for a nested linear model

2007-07-11 Thread Mark Difford

Indeed!  And, apropos of the expression, to be Ripleyed (and so be
condemned to eating cookies for a long, long time), what about being
Billasted?

BestR,
Mark.


Simon Blomberg-4 wrote:
 
 I second the nomination!
 
 Simon.
 
 On Tue, 2007-07-10 at 10:02 -0600, Greg Snow wrote:
 I nominate the following 2 pieces from Bill's reply for fortunes
 (probably 2 separate fortunes):
  
 
 
  All this becomes even more glaring if you take the unusal 
  step of plotting the data.
 
 and
 
  What sort of editor would overlook this clear and 
  demonstrable message leaping out from the data in favour of 
  some arcane argument about types of sums of squares?  
  Several answers come to mind: A power freak, a SAS 
  afficianado, an idiot.
 
 
 -- 
 Simon Blomberg, BSc (Hons), PhD, MAppStat. 
 Lecturer and Consultant Statistician 
 Faculty of Biological and Chemical Sciences 
 The University of Queensland 
 St. Lucia Queensland 4072 
 Australia
 Room 320 Goddard Building (8)
 T: +61 7 3365 2506 
 email: S.Blomberg1_at_uq.edu.au
 
 Policies:
 1.  I will NOT analyse your data for you.
 2.  Your deadline is your problem.
 
 The combination of some data and an aching desire for 
 an answer does not ensure that a reasonable answer can 
 be extracted from a given body of data. - John Tukey.
 
 __
 R-help@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
 and provide commented, minimal, self-contained, reproducible code.
 
 

-- 
View this message in context: 
http://www.nabble.com/type-III-ANOVA-for-a-nested-linear-model-tf4055192.html#a11536509
Sent from the R help mailing list archive at Nabble.com.

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


[R] question about gamm models

2007-07-11 Thread Matthias an der Heiden
Dear R-Users,

I have a question concerning mixed models in R.
The strata of my model are the counties of Germany. The differencies 
between these counties should be modelled as realizations of a normally 
distributed random variable X.
Moreover, the model contains a 0/1 variable A that enters as a fixed 
effect.
The only special feature that should be additionally in the model 
is the following:  

In a usual mixed model the (constant) variance of X will be chosen 
in an optimal way, but I want to fit 2 constant variances, one for 
the subset {A=0} and the other one for the subset {A=1}. Nevertheless 
it should be one and the same random variable X.

I know that it is possible to fit a model with two independent random 
variables X1 and X2 for the subsets {A=0} and {A=1} respectively.
But I want it to be the same! Equivalently the correlation between 
X1 and X2 should be 1.

Can anybody help me in this respect?

Yours sincerely Matthias an der Heiden

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] variable and value labels

2007-07-11 Thread Julien Barnier
Hi Steve,

 I am new here - enjoying the power of R compared to SPSS.
 Looking for sets of tips and tricks for people with old SPSS habits.
 In particular, would like to know an easy way to set variable labels 
 across a dataset and to set value labels for sets of variables.

Maybe you should take a look at the following document :

http://oit.utk.edu/scc/RforSASSPSSusers.pdf

HTH,

Julien

-- 
Julien Barnier
Groupe de recherche sur la socialisation
ENS-LSH - Lyon, France

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


[R] Changing default library

2007-07-11 Thread Schmitt, Corinna

Hallo R experts,

I got a question concerning the .libPaths(). if I do the command .libPaths() 
than the result is /usr/lib/R/library. This is the default folder. I now want 
to change this one into /home/csc/usr/lib/R/library. I thought it would work 
with the command .libPaths(/home/csc/usr/lib/R/library). When I than do the 
command .libPaths() the result is: /usr/lib/R/library  
/home/csc/usr/lib/R/library. But if I start R the next time the result of the 
command .libPaths() is again just /usr/lib/R/library.

Can anyone help me?

Thanks,
Corinna

[[alternative HTML version deleted]]

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Changing default library

2007-07-11 Thread Julien Barnier
Hi,

 When I than do the command .libPaths() the result is:
 /usr/lib/R/library /home/csc/usr/lib/R/library. But if I start R
 the next time the result of the command .libPaths() is again just
 /usr/lib/R/library.

From libPaths help page :

,
| The library search path is initialized at startup from the environment
| variable R_LIBS (which should be a colon-separated list of directories
| at which R library trees are rooted) by calling .libPaths with the
| directories specified in R_LIBS.
`

HTH,

Julien

-- 
Julien Barnier
Groupe de recherche sur la socialisation
ENS-LSH - Lyon, France

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Changing default library

2007-07-11 Thread Achim Zeileis
Corinna:

 I got a question concerning the .libPaths(). if I do the command
 .libPaths() than the result is /usr/lib/R/library. This is the default
 folder. I now want to change this one into /home/csc/usr/lib/R/library.
 I thought it would work with the command
 .libPaths(/home/csc/usr/lib/R/library). When I than do the command
 .libPaths() the result is: /usr/lib/R/library
 /home/csc/usr/lib/R/library. But if I start R the next time the result
 of the command .libPaths() is again just /usr/lib/R/library.

 Can anyone help me?

You should set the R_LIBS environment variable (that the man page of
.libPaths points you to). See also FAQ 5.2.

hth,
Z

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


[R] inquiry about anova and ancova

2007-07-11 Thread Anderson, Mary-Jane
Dear R users,
 I have a rather knotty analysis problem and I was hoping that
someone on this list would be able to help. I was advised to try this list
by a colleague who uses R but it is a statistical inquiry not about how to
use R.
 In brief I have a 3x2 anova, 2 tasks under 3 conditions, within subjects. I
also took a variety of personality measures that might influence the results
under the different conditions. I had thought that an ancova would be the
best test, but it might be the case that this would not work with a within
subjects design. I have not found anything that explicitly states whether or
not it would, but all the examples I have read are between subjects design.
 I also thought of investigating a manova, but it is not really the case
that I have more than one DV, it is the same DV in 6 different combinations
of task and condition. 
 There were 4 personality measures and I wanted to look at the degree to
which they affected the task/ condition interaction. 
 I have explained this briefly here, but I can of course provied more
details to anyone who can advise me further with this.
Thanks,
Mary-Jane Anderson 
Information Analyst 
Platform Project
Information Services Division, 
NHS National Services Scotland, 
Gyle Square, 
1 South Gyle Crescent, 
Edinburgh, 
EH12 9EB. 
0131 275 7163.


_ 
NHS National Services Scotland Disclaimer 

The information contained in this message may be confidentia...{{dropped}}

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


[R] variable and value labels

2007-07-11 Thread Steve Powell
Dear list
I am new here - enjoying the power of R compared to SPSS.
Looking for sets of tips and tricks for people with old SPSS habits.
In particular, would like to know an easy way to set variable labels 
across a dataset and to set value labels for sets of variables.
Grateful for any help,
Steve Powell

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] inquiry about anova and ancova

2007-07-11 Thread Peter Dalgaard
Anderson, Mary-Jane wrote:
 Dear R users,
I have a rather knotty analysis problem and I was hoping that
 someone on this list would be able to help. I was advised to try this list
 by a colleague who uses R but it is a statistical inquiry not about how to
 use R.
  In brief I have a 3x2 anova, 2 tasks under 3 conditions, within subjects. I
 also took a variety of personality measures that might influence the results
 under the different conditions. I had thought that an ancova would be the
 best test, but it might be the case that this would not work with a within
 subjects design. I have not found anything that explicitly states whether or
 not it would, but all the examples I have read are between subjects design.
  I also thought of investigating a manova, but it is not really the case
 that I have more than one DV, it is the same DV in 6 different combinations
 of task and condition. 
  There were 4 personality measures and I wanted to look at the degree to
 which they affected the task/ condition interaction. 
  I have explained this briefly here, but I can of course provied more
 details to anyone who can advise me further with this.
   
This sounds like a job for a Multivariate Linear Model (assuming that
you have complete data for each subject or are prepared to throw away
subjects with missing values).

This lets you decompose the response into mean, effects of task and
condition, and the interaction effect. Each component can then be
separately tested for effect of predictors, using multivariate tests, or
F tests under sphericity assumptions.

Have a look at example(anova.mlm); this mostly looks at cases where
effects are tested against zero, but the last example involves a (bogus)
between subject factor f.

-- 
   O__   Peter Dalgaard Øster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark  Ph:  (+45) 35327918
~~ - ([EMAIL PROTECTED])  FAX: (+45) 35327907

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


[R] p-value from survreg, library(survival)

2007-07-11 Thread vladosr
dear r experts:
I would appreciate advice on how to get the p-value from the object 'sr'
created  with the function survreg() as given below.
vlad

sr-survreg(s~groups, dist=gaussian)
Coefficients:
(Intercept)  groups
-0.02138485  0.03868351

Scale= 0.01789372

Loglik(model)= 31.1   Loglik(intercept only)= 25.4
Chisq= 11.39 on 1 degrees of freedom, p= 0.00074
n= 16

[[alternative HTML version deleted]]

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] inquiry about anova and ancova

2007-07-11 Thread Andrew Robinson
Hi Mary,

it sounds like you have a split-plot design, or more gruesomely, a
split-subject design.  

The model that I infer from your description of the design can be fit
using the lme() function of the nlme() package, along the lines of a
similar analysis documented in section 1.6 of Pinheiro and Bates
(2000).  It should also be possible by using the aov() function in
base R.

Cheers,

Andrew

On Wed, Jul 11, 2007 at 10:50:57AM +0100, Anderson, Mary-Jane wrote:
 Dear R users,
I have a rather knotty analysis problem and I was hoping that
 someone on this list would be able to help. I was advised to try this list
 by a colleague who uses R but it is a statistical inquiry not about how to
 use R.
  In brief I have a 3x2 anova, 2 tasks under 3 conditions, within subjects. I
 also took a variety of personality measures that might influence the results
 under the different conditions. I had thought that an ancova would be the
 best test, but it might be the case that this would not work with a within
 subjects design. I have not found anything that explicitly states whether or
 not it would, but all the examples I have read are between subjects design.
  I also thought of investigating a manova, but it is not really the case
 that I have more than one DV, it is the same DV in 6 different combinations
 of task and condition. 
  There were 4 personality measures and I wanted to look at the degree to
 which they affected the task/ condition interaction. 
  I have explained this briefly here, but I can of course provied more
 details to anyone who can advise me further with this.
 Thanks,
 Mary-Jane Anderson 
 Information Analyst 
 Platform Project
 Information Services Division, 
 NHS National Services Scotland, 
 Gyle Square, 
 1 South Gyle Crescent, 
 Edinburgh, 
 EH12 9EB. 
 0131 275 7163.
 
 
 _ 
 NHS National Services Scotland Disclaimer 
 
 The information contained in this message may be confidentia...{{dropped}}
 
 __
 R-help@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
 and provide commented, minimal, self-contained, reproducible code.

-- 
Andrew Robinson  
Department of Mathematics and StatisticsTel: +61-3-8344-9763
University of Melbourne, VIC 3010 Australia Fax: +61-3-8344-4599
http://www.ms.unimelb.edu.au/~andrewpr
http://blogs.mbs.edu/fishing-in-the-bay/

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Warning message: cannot create HTML package index

2007-07-11 Thread Prof Brian Ripley
On Fri, 6 Jul 2007, Peter Dalgaard wrote:

 Leo wrote:
 On 06/07/2007, Prof Brian Ripley wrote:

 On Fri, 6 Jul 2007, Leo wrote:


 I have set R_LIBS=~/R_lib as I don't have root access.

 The following message shown up every time after installing a package:

  ..
  The downloaded packages are in
/tmp/RtmpBoIPoz/downloaded_packages
  Warning message:
  cannot create HTML package index in: tools:::unix.packages.html(.Library)

 Any ideas?

 It is a correct warning.  What is the problem with being warned?

 R tries to maintain an HTML page of installed packages, but you don't have
 permission to update it.


 Where is that HTML page located on a GNU/Linux system?

 Is it possible to maintain a user HTML page of installed packages?

 Thanks,

 This confuses me a bit too. I had gotten used to the warning without
 thinking about it. It tries to update $RHOME/doc/html/packages.html,
 which starts like this:

 .
 ph3Packages in the standard library/h3
 .

 However, if I run help.start, I get

 help.start()
 Making links in per-session dir ...
 If 'firefox' is already running, it is *not* restarted, and you must
switch to its window.
 Otherwise, be patient ...

 and then it opens (say)
  file:///tmp/RtmpXyp5Cg/.R/doc/html/index.html
 which has a link to
  file:///tmp/RtmpXyp5Cg/.R/doc/html/packages.html

 which looks like this

 
 ph3Packages in /home/bs/pd/Rlibrary/h3
 
 ph3Packages in /usr/lib64/R/library/h3

 I.e. it is autogenerated by help.start and doesn't even look at the file
 in $RHOME. So what puzzles me is

 (a) why we maintain $RHOME/doc/html/packages.html at all

 One argument could be that this is browseable for everyone on a system,
 even without starting R. But then

Some front-end GUIs use it (or used to use it).

 (b) why do we even try updating it when packages are installed in a
 private location?

We don't know that.  Given the use of symbolic links, it is not clear 
which libraries are private and which are links to .Library.  However, we 
could be less cautious about this, and I've altered the code to update 
only if the path matches .Library exactly.

-- 
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

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Installation on Leopard

2007-07-11 Thread Douglas Bates
On 7/11/07, Helin Gai [EMAIL PROTECTED] wrote:
 Hi all,
 I'm wondering whether anyone has installed R on Mac OS X leopard with
 success. I downloaded the latest version, but couldn't have it installed.
 Any idea as to how I get around the problem? Thanks!

Simon Urbanek has comments about R for Leopard on his Wiki.  Check
R.research.att.com and wiki.Urbanek.info

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


[R] p-value from survreg(), library(survival)

2007-07-11 Thread Vlado Sremac
dear r experts:
It seems my message got spam filtered, another try:
i would appreciate advice on how to get the p-value from the object 'sr'
created  with the function survreg() as given below.
vlad

sr-survreg(s~groups, dist=gaussian)
Coefficients:
(Intercept)  groups
-0.02138485  0.03868351

Scale= 0.01789372

Loglik(model)= 31.1   Loglik(intercept only)= 25.4
Chisq= 11.39 on 1 degrees of freedom, p= 0.00074
n= 16

[[alternative HTML version deleted]]

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


[R] Some questions about quadratic programming (QP)

2007-07-11 Thread Amir Safari
 
   
 Dear R Users , 
 
As a beginner in QP, I'm trying to solve a Support Vector Machine problem by a 
QP. In particulare I am using the quadprog package.
My questions are here: 
1- In the document for the package (The quadprog Package), the inequality 
constraint is mentioned with = , however in a standard QP, this usaully is 
written with = . This constraint should be multiplied by a negativity sign to 
be standard ? 
2- How about nonnegativity constraints ? Are that possible to be handled via 
upper and lower bounds? In document, nonnegativity is not mentioned. Is there 
any argument for that? 
3- In QP formulation we have a constant 1/2 in objective function. This should 
be multiplied by the user or it is done by the algorithm? 
4- More important, when I multiply a b*b matrix by D in quadratic term of 
objective function, I get thise message: 
Error in solve.QP(Dmat, dvec, Amat, bvec) : 
   matrix D in quadratic function is not positive definite! 
How to multiply b*b matrix by the diagonal matrix ? 


Thank you very much for any help. 

Amir 

   
-
Park yourself in front of a world of choices in alternative vehicles.

[[alternative HTML version deleted]]

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


[R] CDF for pareto distribution

2007-07-11 Thread livia

Hi, I would like to use the following codes to plot the CDF for pareto
distribution. Before doing this, I have plot the emperical one. 

x - seq(1.6, 3, 0.1) 
lines(x,pgpd(x, 1.544,0.4477557,), col=red) 

Could anyone give me some advice whether the above codes are correct?

Many thanks.
-- 
View this message in context: 
http://www.nabble.com/CDF-for-pareto-distribution-tf4061253.html#a11538272
Sent from the R help mailing list archive at Nabble.com.

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


[R] Antigen found FILE FILTER= *.pif file

2007-07-11 Thread Antigen_UM-TSMTPOUT1
Antigen for Exchange found instruction.zip__instruction.doc 


 .pif matching FILE FILTER=  *.pif file filter.
The file is currently Purged.  The message, DELIVERY REPORTS ABOUT YOUR 
E_MAIL, was
sent from [EMAIL PROTECTED] and was discovered in SMTP Messages\Inbound And 
Outbound
located at University of Missouri/UM System/UM-TSMTPOUT1.

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


[R] RWeka control parameters classifiers interface

2007-07-11 Thread strinz
Hello,

  I have some trouble in achieving the desired parametrisation
  for the weka classifier functions, using the package RWeka.

  The problem is, that the functions
  result=classifier(formula, data, subset, na.action, control = 
Weka_control(mycontrol))
  do not seem to be manipulated by the mycontrol- arguments

  Perhaps this should be resepected via the handlers- argument ,
  but the documentation in this regard is rather sparse. 

# - Examples

file  =system.file(arff,iris.arff,package=RWeka) 
data  =read.arff(file=file) 
rownames(data)=1:nrow(data) 
colnames(data)[ncol(data)]  =class

library(RWeka)

# Example: no parameter influence
mySMO 
=make_Weka_classifier(name=weka/classifiers/functions/SMO,class=NULL,handlers=list());
 
# Using control =Weka_control()
m1 
=mySMO(formula=class~.,data=data[,],control=Weka_control(K=weka.classifiers.functions.supportVector.PolyKernel,E=2))

m2 
=mySMO(formula=class~.,data=data[,],control=Weka_control(K=weka.classifiers.functions.supportVector.PolyKernel,E=3))
 
m3 
=mySMO(formula=class~.,data=data[,],control=c(K,weka.classifiers.functions.supportVector.PolyKernel,E,3))
 
# Using predefinded interface, does not work 
x1  
=SMO(formula=class~.,data=data[,],control=Weka_control(K=weka.classifiers.functions.supportVector.PolyKernel,E=2))

x2  
=SMO(formula=class~.,data=data[,],control=Weka_control(K=weka.classifiers.functions.supportVector.PolyKernel,E=3))

m1$call   
m2$call   
m3$call 
x1$call
x2$call
# no differences:
m1 
m2 
m3
x1
x2

Any suggestions?
Many thanks
Bjoern

many thanks
bjoern

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Previously saved workspace restored

2007-07-11 Thread john seers \(IFR\)
 

Hi

If you enter the command ls()you will see a list of names that have
come with the .Rdata file you double-clicked.

If you enter one of these names at the command prompt you will see the
data.

So, for example if you have some data called mydata:



 ls()
[1] mydata repos 
 mydata
 [,1] [,2] [,3]
[1,]147
[2,]258
[3,]369
 


Regards

John


 
---

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Kristi Glover
Sent: 11 July 2007 05:18
To: r-help@stat.math.ethz.ch
Subject: [R] Previously saved workspace restored

hi there,
i an beginner of R. some one have sent me a file (extension is .Rdata).
i have  installed R in my computer and i just double clicked the data.
then it automatically opened R programme and displayed that [previously
saved workspace restored]. the following message was displayed. 
 
Type 'demo()' for some demos, 'help()' for on-line help,
or'help.start()' for an HTML browser interface to help.Type 'q()' to
quit R.
 
[Previously saved workspace restored]
 
but how  can I see the data (table) which is saved (in R format) in R?,

 
i hope you will help me. 
 
Kristi Glover
 
 
 
 
_
Explore the seven wonders of the world

BRE
[[alternative HTML version deleted]]

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] type III ANOVA for a nested linear model

2007-07-11 Thread Carsten Jaeger
Hello Peter,

thanks for your help. I'm quite sure that I specified the right model.
Factor C is indeed nested within factor A. I think you were confused by
the numbering of C (1..11), and it is easier to understand when I code
it as you suggested (1,2,3 within each level of A, as in mydata1 [see
below]). However, it does not matter which numbering I choose for
carrying the analysis, as

anova(lm(resp ~ A * B + (C %in% A), mydata))
anova(lm(resp ~ A * B + (C %in% A), mydata1))

both give the same results (as at least I had expected because of the
nesting).

However, I found that Anova() from the car package only accepts the
second version. So,

Anova(lm(resp ~ A * B + (C %in% A), mydata)) does not work (giving an
error) but
Anova(lm(resp ~ A * B + (C %in% A), mydata1)) does.

This behaviour is rather confusing, or is there anything I'm missing?

Thanks for your help again, 

Carsten


R mydata
  A B  C resp
1 1 1  1 34.12
2 1 1  2 32.45
3 1 1  3 44.55
4 1 2  1 20.88
5 1 2  2 22.32
6 1 2  3 27.71
7 2 1  6 38.20
8 2 1  7 31.62
9 2 1  8 38.71
102 2  6 18.93
112 2  7 20.57
122 2  8 31.55
133 1  9 40.81
143 1 10 42.23
153 1 11 41.26
163 2  9 28.41
173 2 10 24.07
183 2 11 21.16

R mydata1
  A B  C resp
1 1 1  1 34.12
2 1 1  2 32.45
3 1 1  3 44.55
4 1 2  1 20.88
5 1 2  2 22.32
6 1 2  3 27.71
7 2 1  1 38.20
8 2 1  2 31.62
9 2 1  3 38.71
102 2  1 18.93
112 2  2 20.57
122 2  3 31.55
133 1  1 40.81
143 1  2 42.23
153 1  3 41.26
163 2  1 28.41
173 2  2 24.07
183 2  3 21.16


On Tue, 2007-07-10 at 13:54 +0200, Peter Dalgaard wrote:
 Carsten Jaeger wrote:
  Hello,
 
  is it possible to obtain type III sums of squares for a nested model as
  in the following:
 
  lmod - lm(resp ~ A * B + (C %in% A), mydata))
 
  I have tried
 
  library(car)
  Anova(lmod, type=III)
 
  but this gives me an error (and I also understand from the documentation
  of Anova as well as from a previous request
  (http://finzi.psych.upenn.edu/R/Rhelp02a/archive/64477.html) that it is
  not possible to specify nested models with car's Anova).
 
  anova(lmod) works, of course.
 
  My data (given below) is balanced so I expect the results to be similar
  for both type I and type III sums of squares. But are they *exactly* the
  same? The editor of the journal which I'm sending my manuscript to
  requests what he calls conventional type III tests and I'm not sure if

  can convince him to accept my type I analysis.
 In balanced designs, type I-IV SSD's are all identical. However, I don't 
 think the model does what I think you think it does. 
 
 Notice that nesting is used with two diferent meanings, in R it would be 
 that the codings of C only makes sense within levels of A - e.g. if they were 
 numbered 1:3 within each group, but with C==1 when A==1 having nothing to do 
 with C==1 when A==2.  SAS does something. er. else...
 
 What I think you want is a model where C is a random terms so that main 
 effects of A can be tested, like in
 
  summary(aov(resp ~ A * B + Error(C), dd))
 
 Error: C
   Df  Sum Sq Mean Sq F value Pr(F)
 A  2  33.123  16.562  0.4981 0.6308
 Residuals  6 199.501  33.250
 
 Error: Within
   Df Sum Sq Mean Sq F value   Pr(F)
 B  1 915.21  915.21 83.7846 9.57e-05 ***
 A:B2  16.138.07  0.7384   0.5168
 Residuals  6  65.54   10.92
 ---
 Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
 
 
 (This is essentially the same structure as Martin Bleichner had earlier 
 today, also @web.de. What is this? an epidemic? ;-))
 


__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] RWeka control parameters classifiers interface

2007-07-11 Thread Achim Zeileis
On Wed, 11 Jul 2007 [EMAIL PROTECTED] wrote:

   The problem is, that the functions
   result=classifier(formula, data, subset, na.action, control = 
 Weka_control(mycontrol))
   do not seem to be manipulated by the mycontrol- arguments

Yes, they are...not all parameter changes have always an effect on the
specified learner.

   Perhaps this should be resepected via the handlers- argument ,
   but the documentation in this regard is rather sparse.

Handlers are not needed here.

Re: sparse docs. In case you have not seen that paper already, there is a
technical report on the ideas behind RWeka:
  http://epub.wu-wien.ac.at/dyn/openURL?id=oai:epub.wu-wien.ac.at:epub-wu-01_ba6

Re: SMO. Compare

m1 - SMO(Species ~ ., data = iris)
m2 - SMO(Species ~ ., data = iris, control = Weka_control(
  K = weka.classifiers.functions.supportVector.RBFKernel))

which yield different results so the Weka_control() works.

The same happens if you register the mySMO() interface yourself. I'm not
sure why the E = ... argument has no influence on the SMO, please check
the Weka docs for this particular learner.

Best,
Z

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] variable and value labels

2007-07-11 Thread Frank E Harrell Jr
Steve Powell wrote:
 Dear list
 I am new here - enjoying the power of R compared to SPSS.
 Looking for sets of tips and tricks for people with old SPSS habits.
 In particular, would like to know an easy way to set variable labels 
 across a dataset and to set value labels for sets of variables.
 Grateful for any help,
 Steve Powell

In the Hmisc package see the functions spss.get, label, upData, and 
describe.
Frank

-- 
Frank E Harrell Jr   Professor and Chair   School of Medicine
  Department of Biostatistics   Vanderbilt University

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


[R] 3D plot and interactive PDFs

2007-07-11 Thread Bruno C\.
With version 8 of acrobat reader, it is now possible to have 3D in PDf 
documents.
Does it exist already an R package who manage to produce 3D plots which can be 
saved as interactive 3D graphs in a PDF file?

Best Regards
Bruno Cavestro


--
Leggi GRATIS le tue mail con il telefonino i-mode™ di Wind
http://i-mode.wind.it/

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


[R] elementary statistics with R (rkward?)

2007-07-11 Thread Donatas G.
Hi, I am trying to learn some basic statistics stuff but I cannot find any
elementary statistics exercises using R language. Using RKward would be even
better...

I need that in analysing sociological data, obtained through questionnairres -
findind corelations between variables, relations between different types of
data, etc.

Could anyone recommend simple tutorials/exercises, available on www for me to
work on?

I realize it would be much simple to do this introductory stuff with spss, that
everyone around me is using here in Lithuania, but I'd really like to learn to
do it with R instead...

-- 
Donatas G.

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] elementary statistics with R (rkward?)

2007-07-11 Thread Sarah Goslee
I don't know anything about RKward, but there are many, many
tutorials, guides and other documents written for people learning R
available online.
Try the introduction to R at:
http://www.r-project.org/
under manuals, or some of the many fine contributions at:

http://cran.r-project.org/other-docs.html

Sarah

On 7/11/07, Donatas G. [EMAIL PROTECTED] wrote:
 Hi, I am trying to learn some basic statistics stuff but I cannot find any
 elementary statistics exercises using R language. Using RKward would be even
 better...

 I need that in analysing sociological data, obtained through questionnairres -
 findind corelations between variables, relations between different types of
 data, etc.

 Could anyone recommend simple tutorials/exercises, available on www for me to
 work on?

 I realize it would be much simple to do this introductory stuff with spss, 
 that
 everyone around me is using here in Lithuania, but I'd really like to learn to
 do it with R instead...

 --
 Donatas G.


-- 
Sarah Goslee
http://www.functionaldiversity.org

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] elementary statistics with R (rkward?)

2007-07-11 Thread Charles Annis, P.E.
Face the music and buy the book: _Introductory Statistics with R_ by Peter
Dalgaard.  It's perfect for what you need.  It's clear and concise and will
teach you statistics AND R as painlessly as such a thing can be.  It's
inexpensive and you can get it on Amazon.com and every other major
bookseller, including the nearest university bookstore.

Charles Annis, P.E.

[EMAIL PROTECTED]
phone: 561-352-9699
eFax:  614-455-3265
http://www.StatisticalEngineering.com
 
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Donatas G.
Sent: Wednesday, July 11, 2007 9:27 AM
To: r-help@stat.math.ethz.ch
Subject: [R] elementary statistics with R (rkward?)

Hi, I am trying to learn some basic statistics stuff but I cannot find any
elementary statistics exercises using R language. Using RKward would be even
better...

I need that in analysing sociological data, obtained through questionnairres
-
findind corelations between variables, relations between different types of
data, etc.

Could anyone recommend simple tutorials/exercises, available on www for me
to
work on?

I realize it would be much simple to do this introductory stuff with spss,
that
everyone around me is using here in Lithuania, but I'd really like to learn
to
do it with R instead...

-- 
Donatas G.

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] CDF for pareto distribution

2007-07-11 Thread Vincent Goulet
Le 07-07-11 à 07:56, livia a écrit :


 Hi, I would like to use the following codes to plot the CDF for pareto
 distribution. Before doing this, I have plot the emperical one.

 x - seq(1.6, 3, 0.1)
 lines(x,pgpd(x, 1.544,0.4477557,), col=red)

 Could anyone give me some advice whether the above codes are correct?

 Many thanks.

livia,

You seem to be struggling with the Pareto distribution... The above  
code seems correct, but you do not say where you took the pdpd()  
function from. This makes it harder for us to help you.

In you other message (https://stat.ethz.ch/pipermail/r-help/2007-July/ 
136137.html) you quote a negative scale parameter. The Pareto I know  
has strictly positive shape and scale parameters.

Perhaps can you retry with functions ppareto() or pgenpareto() of  
package actuar.

---
   Vincent Goulet, Associate Professor
   École d'actuariat
   Université Laval, Québec
   [EMAIL PROTECTED]   http://vgoulet.act.ulaval.ca

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Previously saved workspace restored

2007-07-11 Thread Kristi Glover
hi,
thanks for the suggestion, however i am struggling to see the data, here is  
load(C://R//species.Rdata) ls()[1] abc  abc1 abc2  
   example  example1.14  generalislast.warningwhen i wrote 
ls(), then i saw the the files names I created before in R. there was no 
problem for the files  which was created in R. but still i could not see the 
data which was received from email. species data was downloaded from email.  i 
checked for .txt files. it worked but downloaded  .Rdata is not working using 
ls().  is any supporting files needed to open the downloaded files?   thanks 
for your suggestions  bye  Kristi



 Subject: RE: [R] Previously saved workspace restored Date: Wed, 11 Jul 2007 
 13:19:06 +0100 From: [EMAIL PROTECTED] To: [EMAIL PROTECTED]; 
 r-help@stat.math.ethz.chHi  If you enter the command ls()you will 
 see a list of names that have come with the .Rdata file you double-clicked. 
  If you enter one of these names at the command prompt you will see the 
 data.  So, for example if you have some data called mydata: 
 ls() [1] mydata repos   mydata [,1] [,2] [,3] [1,] 1 4 7 [2,] 2 5 
 8 [3,] 3 6 9 Regards  John---  -Original 
 Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of 
 Kristi Glover Sent: 11 July 2007 05:18 To: r-help@stat.math.ethz.ch 
 Subject: [R] Previously saved workspace restored  hi there, i an beginner 
 of R. some one have sent me a file (extension is .Rdata). i have installed R 
 in my computer and i just double clicked the data. !
 then it automatically opened R programme and displayed that [previously saved 
workspace restored]. the following message was displayed.   Type 'demo()' for 
some demos, 'help()' for on-line help, or'help.start()' for an HTML browser 
interface to help.Type 'q()' to quit R.  [Previously saved workspace 
restored]  but how can I see the data (table) which is saved (in R format) in 
R?,   i hope you will help me.   Kristi Glover 
_ Explore the 
seven wonders of the world  BRE [[alternative HTML version deleted]]  
__ R-help@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 and provide 
commented, minimal, self-contained, reproducible code.
_
Discover the new Windows Vista

[[alternative HTML version deleted]]

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] CDF for pareto distribution

2007-07-11 Thread livia

Hi, thank you very much for your reply. The function pgpd() is from the
package POT, and the 1.544 is the location parameter, 0.4477557 is the scale
parameter and -0.50113 is the shape parameter, which can be both negtive or
positive.


Vincent Goulet wrote:
 
 Le 07-07-11 à 07:56, livia a écrit :
 

 Hi, I would like to use the following codes to plot the CDF for pareto
 distribution. Before doing this, I have plot the emperical one.

 x - seq(1.6, 3, 0.1)
 lines(x,pgpd(x, 1.544,0.4477557,-0.50113), col=red)

 Could anyone give me some advice whether the above codes are correct?

 Many thanks.
 
 livia,
 
 You seem to be struggling with the Pareto distribution... The above  
 code seems correct, but you do not say where you took the pdpd()  
 function from. This makes it harder for us to help you.
 
 In you other message (https://stat.ethz.ch/pipermail/r-help/2007-July/ 
 136137.html) you quote a negative scale parameter. The Pareto I know  
 has strictly positive shape and scale parameters.
 
 Perhaps can you retry with functions ppareto() or pgenpareto() of  
 package actuar.
 
 ---
Vincent Goulet, Associate Professor
École d'actuariat
Université Laval, Québec
[EMAIL PROTECTED]   http://vgoulet.act.ulaval.ca
 
 __
 R-help@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
 and provide commented, minimal, self-contained, reproducible code.
 
 

-- 
View this message in context: 
http://www.nabble.com/CDF-for-pareto-distribution-tf4061253.html#a11540928
Sent from the R help mailing list archive at Nabble.com.

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] p-value from survreg(), library(survival)

2007-07-11 Thread hadley wickham
str(survreg(s~groups, dist=gaussian))

is probably a good place to start.

Hadley

On 7/11/07, Vlado Sremac [EMAIL PROTECTED] wrote:
 dear r experts:
 It seems my message got spam filtered, another try:
 i would appreciate advice on how to get the p-value from the object 'sr'
 created  with the function survreg() as given below.
 vlad

 sr-survreg(s~groups, dist=gaussian)
 Coefficients:
 (Intercept)  groups
 -0.02138485  0.03868351

 Scale= 0.01789372

 Loglik(model)= 31.1   Loglik(intercept only)= 25.4
 Chisq= 11.39 on 1 degrees of freedom, p= 0.00074
 n= 16

 [[alternative HTML version deleted]]

 __
 R-help@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
 and provide commented, minimal, self-contained, reproducible code.


__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


[R] Power calculation for the time series experiment

2007-07-11 Thread A Ezhil
Hi All,

We are planning to run an experiment, where samples
will be taken at different time points (say, 0, 4, 8,
16, 24). If I am interested in the effect size of 1.5
for a reasonably large samples (say 500), what will be
the power? Is it a good idea to use F-test (one-way
ANOVA) as my test statistics?  How can we include
correlation structure among samples in the power
analysis, if I use one-way ANOVA design? 

I am aware of power.anova.test() in R that will help
me to do power calculation for one-way ANOVA.  It will
be of great help if you send me some related articles
or pointers to some useful resources.

Thanks in advance.

Kind regards,
Ezhil

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] 3D plot and interactive PDFs

2007-07-11 Thread Duncan Murdoch
On 7/11/2007 9:18 AM, Bruno C. wrote:
 With version 8 of acrobat reader, it is now possible to have 3D in PDf 
 documents.
 Does it exist already an R package who manage to produce 3D plots which can 
 be saved as interactive 3D graphs in a PDF file?

No, not as far as I know.  If you want to help to make it happen, I'd 
suggest working to add it to the GL2PS project 
(http://www.geuz.org/gl2ps) and then it should be automatically 
incorporated into the rgl package.

Duncan Murdoch

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] type III ANOVA for a nested linear model

2007-07-11 Thread Andrew Robinson
Billasted sounds too brutal.  How about Billeted, as in what one
does to one's breshly-caught bish?  

Andrew


On Wed, Jul 11, 2007 at 01:48:10AM -0700, Mark Difford wrote:
 
 Indeed!  And, apropos of the expression, to be Ripleyed (and so be
 condemned to eating cookies for a long, long time), what about being
 Billasted?
 
 BestR,
 Mark.
 
 
 Simon Blomberg-4 wrote:
  
  I second the nomination!
  
  Simon.
  
  On Tue, 2007-07-10 at 10:02 -0600, Greg Snow wrote:
  I nominate the following 2 pieces from Bill's reply for fortunes
  (probably 2 separate fortunes):
   
  
  
   All this becomes even more glaring if you take the unusal 
   step of plotting the data.
  
  and
  
   What sort of editor would overlook this clear and 
   demonstrable message leaping out from the data in favour of 
   some arcane argument about types of sums of squares?  
   Several answers come to mind: A power freak, a SAS 
   afficianado, an idiot.
  
  
  -- 
  Simon Blomberg, BSc (Hons), PhD, MAppStat. 
  Lecturer and Consultant Statistician 
  Faculty of Biological and Chemical Sciences 
  The University of Queensland 
  St. Lucia Queensland 4072 
  Australia
  Room 320 Goddard Building (8)
  T: +61 7 3365 2506 
  email: S.Blomberg1_at_uq.edu.au
  
  Policies:
  1.  I will NOT analyse your data for you.
  2.  Your deadline is your problem.
  
  The combination of some data and an aching desire for 
  an answer does not ensure that a reasonable answer can 
  be extracted from a given body of data. - John Tukey.
  
  __
  R-help@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
  and provide commented, minimal, self-contained, reproducible code.
  
  
 
 -- 
 View this message in context: 
 http://www.nabble.com/type-III-ANOVA-for-a-nested-linear-model-tf4055192.html#a11536509
 Sent from the R help mailing list archive at Nabble.com.
 
 __
 R-help@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
 and provide commented, minimal, self-contained, reproducible code.

-- 
Andrew Robinson  
Department of Mathematics and StatisticsTel: +61-3-8344-9763
University of Melbourne, VIC 3010 Australia Fax: +61-3-8344-4599
http://www.ms.unimelb.edu.au/~andrewpr
http://blogs.mbs.edu/fishing-in-the-bay/

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] ECDF, distribution of Pareto, distribution of Normal

2007-07-11 Thread J. R. M. Hosking
livia wrote:
 Hello all,
 
 I would like to plot the emperical CDF, normal CDF and pareto CDF in the
 same graph and I amusing the following codes. z is a vector and I just
 need the part when z between 1.6 and 3.
 
 plot(ecdf(z), do.points=FALSE, verticals=TRUE,
 xlim=c(1.6,3),ylim=c(1-sum(z1.6)/length(z), 1))
 
 x - seq(1.6, 3, 0.1)
 lines(x,pgpd(x, 1.544,0.4373,-0.2398), col=red)
 
 y - seq(1.6, 3, 0.1)
 lines(y,pnorm(y, mean(z),sqrt(var(z))), col=blue)
 
 The emperical CDF and normal CDF look rather resonable, but the pareto CDF
 looks quite odd. I am not sure whether I plot the pareto CDF correctly e.g.
 in the right yaxs or any other mistake?
 
 At the same time, let t represents the vector whose values are larger than
 1.6(the part we want). If I implement the following codes and plot the
 emperical CDF and pareto CDF, the pareto CDF seems fit.
 
 plot(ecdf(t), do.points=FALSE, verticals=TRUE)
 x - seq(1.6, 3, 0.1)
 lines(x,pgpd(x, 1.544,0.4373,-0.2398), col=red)
 
 Could anyone give me some advice on this? Many thanks.

If any of your data points are less than 1.6, ecdf(z) and ecdf(t)
will be different functions: for arguments greater than 1.6,
the former will take values in c(mean(z1.6),1) and the latter
will cover the range (0,1).  It is not surprising that your
pgpd function will fit only one of these empirical cdf's closely.

Assuming that those GPD parameters were obtained by fitting to just
the data values greater than 1.6, the GPD curve in your first plot
should be

   u-mean(z1.6)
   x-seq(1.6,3,0.1)
   lines(x, u + (1-u)*pgpd(x, parameters )


J. R. M. Hosking

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] p-value from survreg(), library(survival)

2007-07-11 Thread Henrique Dallazuanna
Try also:

pchisq(summary(sr)$chi, degrees_freedom, lower=FALSE)

*You need know your degrees of freedom

-- 
Henrique Dallazuanna
Curitiba-Paraná-Brasil
25° 25' 40 S 49° 16' 22 O


On 11/07/07, Vlado Sremac [EMAIL PROTECTED] wrote:
 dear r experts:
 It seems my message got spam filtered, another try:
 i would appreciate advice on how to get the p-value from the object 'sr'
 created  with the function survreg() as given below.
 vlad

 sr-survreg(s~groups, dist=gaussian)
 Coefficients:
 (Intercept)  groups
 -0.02138485  0.03868351

 Scale= 0.01789372

 Loglik(model)= 31.1   Loglik(intercept only)= 25.4
 Chisq= 11.39 on 1 degrees of freedom, p= 0.00074
 n= 16

 [[alternative HTML version deleted]]

 __
 R-help@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
 and provide commented, minimal, self-contained, reproducible code.


__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


[R] survfit for interval censored data

2007-07-11 Thread Sandra Ellis
pHello,/ppI am a new R-user and would like to use survfit for interval 
censored data. 
Whenever I try I get an error message that states I can only use survfit for 
right censored or
counting process data.  I was wondering if anyone knows if there is an 
additional package available
that can calculate KM curves for interval censored data, or another program 
with this
capability?/ppThank you./ppS. Ellis (student)/p

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] p-value from survreg(), library(survival)

2007-07-11 Thread Marc Schwartz
Actually, in this case, looking at the code for:

  survival:::print.survreg

would be better, as the p value is calculate there, rather than being
part of the survreg object. As with many R functions, the p value is
calculated in the print method for the object.

In this case, it is a pretty straightforward p value for the chi-square
statistic.  Using the output of Vlado's example below:

 format(signif(1 - pchisq(11.39, 1), 2))
[1] 0.00074

HTH,

Marc Schwartz

On Wed, 2007-07-11 at 16:11 +0200, hadley wickham wrote:
 str(survreg(s~groups, dist=gaussian))
 
 is probably a good place to start.
 
 Hadley
 
 On 7/11/07, Vlado Sremac [EMAIL PROTECTED] wrote:
  dear r experts:
  It seems my message got spam filtered, another try:
  i would appreciate advice on how to get the p-value from the object 'sr'
  created  with the function survreg() as given below.
  vlad
 
  sr-survreg(s~groups, dist=gaussian)
  Coefficients:
  (Intercept)  groups
  -0.02138485  0.03868351
 
  Scale= 0.01789372
 
  Loglik(model)= 31.1   Loglik(intercept only)= 25.4
  Chisq= 11.39 on 1 degrees of freedom, p= 0.00074
  n= 16
 

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] p-value from survreg(), library(survival)

2007-07-11 Thread hadley wickham
On 7/11/07, Marc Schwartz [EMAIL PROTECTED] wrote:
 Actually, in this case, looking at the code for:

   survival:::print.survreg

 would be better, as the p value is calculate there, rather than being
 part of the survreg object. As with many R functions, the p value is
 calculated in the print method for the object.

I wish print methods wouldn't do that. Printing is supposed to be
about displaying existing create, not creating new values.

Hadley

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] CDF for pareto distribution

2007-07-11 Thread Vincent Goulet
Le 07-07-11 à 10:01, livia a écrit :


 Hi, thank you very much for your reply. The function pgpd() is from  
 the
 package POT, and the 1.544 is the location parameter, 0.4477557 is  
 the scale
 parameter and -0.50113 is the shape parameter, which can be both  
 negtive or
 positive.

The documentation of POT states that the scale parameter must be  
positive. You seem right about the shape parameter, though; POT uses  
a different parametrization from the one I'm used to.

The problem with

  x - seq(1.6, 3, 0.1)
  lines(x,pgpd(x, 1.544,0.4477557,-0.50113), col=red)

is that lines() must be used to add to an already existing graphic.  
For a new plot, use

  x - seq(1.6, 3, 0.1)
  plot(x,pgpd(x, 1.544,0.4477557,-0.50113), col=red)

which works just fine here.

We cannot help you more if you do not give a *reproducible* example  
of what is going wrong.

If you have issues with the pgpd() function, you should contact the  
maintainer of package POT, as the Posting Guide asks.

HTH



 Vincent Goulet wrote:

 Le 07-07-11 à 07:56, livia a écrit :


 Hi, I would like to use the following codes to plot the CDF for  
 pareto
 distribution. Before doing this, I have plot the emperical one.

 x - seq(1.6, 3, 0.1)
 lines(x,pgpd(x, 1.544,0.4477557,-0.50113), col=red)

 Could anyone give me some advice whether the above codes are  
 correct?

 Many thanks.

 livia,

 You seem to be struggling with the Pareto distribution... The above
 code seems correct, but you do not say where you took the pdpd()
 function from. This makes it harder for us to help you.

 In you other message (https://stat.ethz.ch/pipermail/r-help/2007- 
 July/
 136137.html) you quote a negative scale parameter. The Pareto I know
 has strictly positive shape and scale parameters.

 Perhaps can you retry with functions ppareto() or pgenpareto() of
 package actuar.

 ---
Vincent Goulet, Associate Professor
École d'actuariat
Université Laval, Québec
[EMAIL PROTECTED]   http://vgoulet.act.ulaval.ca

 __
 R-help@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
 and provide commented, minimal, self-contained, reproducible code.



 -- 
 View this message in context: http://www.nabble.com/CDF-for-pareto- 
 distribution-tf4061253.html#a11540928
 Sent from the R help mailing list archive at Nabble.com.

 __
 R-help@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
 and provide commented, minimal, self-contained, reproducible code.

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] 3D plot and interactive PDFs

2007-07-11 Thread vito muggeo
This does not answer exactly to your question, anyway..:

If you are planning to use latex, the package movie15 allows to include 
media files in your document (to be processed via pdflatex)

vito



Bruno C. wrote:
 With version 8 of acrobat reader, it is now possible to have 3D in PDf 
 documents.
 Does it exist already an R package who manage to produce 3D plots which can 
 be saved as interactive 3D graphs in a PDF file?
 
 Best Regards
 Bruno Cavestro
 
 
 --
 Leggi GRATIS le tue mail con il telefonino i-mode™ di Wind
 http://i-mode.wind.it/
 
 __
 R-help@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
 and provide commented, minimal, self-contained, reproducible code.
 
 

-- 

Vito M.R. Muggeo
Dip.to Sc Statist e Matem `Vianelli'
Università di Palermo
viale delle Scienze, edificio 13
90128 Palermo - ITALY
tel: 091 6626240
fax: 091 485726/485612

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


[R] R CMD SHLIB problem with -lg2c and make:

2007-07-11 Thread Richard Zur
Hello,

I have 2 problems with R CMD SHLIB.  The first problem didn't resolve, 
it just morphed into the new problem.  I first have to admit that even 
though I've used R CMD SHLIB for a few years, I don't understand C 
compiling.

The problem arose after our linux guy upgraded from Mandriva 2005 to 
Mandriva 2007.  I was using R 2.4.1, but now it's upgraded to the 
current version.  I used R CMD SHLIB to compile a C file that also 
linked to some fortran code.  The error was something along the lines of 
not being able to find -lg2c.  The gcc version I'm using is now 4.1.1, 
so our linux guy suggested the problem might be related to gfortran and 
f2c.  I'm not sure... is this enough information to know what might be 
going on?

So, I started looking around the FAQs online to try and figure out the 
problem and stumbled upon the R CMD COMPILE command.  I ran it on my C 
and fortran code and didn't see any errors.  I thought that was funny, 
so I erased the .o files it had created and tried again, with COMPILE 
and SHLIB... but now I get the error

make: *** No rule to make target 'mhroc.o'. Stop.

I have no idea what I did or how to correct it.  Can anyone help?

Thank you,
Richard Zur

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


[R] installing, removing, upgrading, and downgrading packages

2007-07-11 Thread Christopher W. Ryan
I'm very new to R, trying to learn it.  I started with R 2.4, but I have
since upgraded to 2.5.0, on WindowsXP.  I understand that 2.5.1 is now
available.

Last night in the course of things I loaded libraries coin and
survival.  I received warning messages that they had been built under
version 2.5.1.  However, as far as I could tell, they worked OK.  But
this brought some questions to mind:

I found the remove.packages() command.  Is there a way to revert a
package back to a previous version without removing it?  If not, and I
remove one version, how do I specify downloading a particular (earlier)
version?

Was that warning of any consequence?  Are there times when a package
will not work properly with an earlier version of R, and will this be
obvious to me when I try to use it?  Or in a more general sense, are
there foreseeable circumstances in which an older version of a package
would be necessary, rather than the newest one?

Should I keep my packages in a library folder outside of the R install
folder?  Right now, it appears that all the packages I download get
installed into a library subdirectory under my R250 directory.
Advantages and disadvantages of either method?

Thanks.
-- 
Christopher W. Ryan, MD
SUNY Upstate Medical University Clinical Campus at Binghamton
40 Arch Street, Johnson City, NY  13790
cryanatbinghamtondotedu
PGP public keys available at http://home.stny.rr.com/ryancw/

If you want to build a ship, don't drum up the men to gather wood,
divide the work and give orders. Instead, teach them to yearn for the
vast and endless sea.  [Antoine de St. Exupery]

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] elementary statistics with R (rkward?)

2007-07-11 Thread Christopher W. Ryan
As a fellow beginner, I also found Handbook of Statistical Analyses
Using R, by Brian Everitt, to be a very useful book.  There is an
accompanying R package, HSAUR.

Also Using R for Introductory Statistics, by John Verzani.  There is an
accompanying R package, UsingR.

Christopher W. Ryan, MD
SUNY Upstate Medical University Clinical Campus at Binghamton
40 Arch Street, Johnson City, NY  13790
cryanatbinghamtondotedu
PGP public keys available at http://home.stny.rr.com/ryancw/

If you want to build a ship, don't drum up the men to gather wood,
divide the work and give orders. Instead, teach them to yearn for the
vast and endless sea.  [Antoine de St. Exupery]

Charles Annis, P.E. wrote:
 Face the music and buy the book: _Introductory Statistics with R_ by Peter
 Dalgaard.  It's perfect for what you need.  It's clear and concise and will
 teach you statistics AND R as painlessly as such a thing can be.  It's
 inexpensive and you can get it on Amazon.com and every other major
 bookseller, including the nearest university bookstore.
 
 Charles Annis, P.E.
 
 [EMAIL PROTECTED]
 phone: 561-352-9699
 eFax:  614-455-3265
 http://www.StatisticalEngineering.com
  
 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of Donatas G.
 Sent: Wednesday, July 11, 2007 9:27 AM
 To: r-help@stat.math.ethz.ch
 Subject: [R] elementary statistics with R (rkward?)
 
 Hi, I am trying to learn some basic statistics stuff but I cannot find any
 elementary statistics exercises using R language. Using RKward would be even
 better...
 
 I need that in analysing sociological data, obtained through questionnairres
 -
 findind corelations between variables, relations between different types of
 data, etc.
 
 Could anyone recommend simple tutorials/exercises, available on www for me
 to
 work on?
 
 I realize it would be much simple to do this introductory stuff with spss,
 that
 everyone around me is using here in Lithuania, but I'd really like to learn
 to
 do it with R instead...


__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] type III ANOVA for a nested linear model

2007-07-11 Thread Peter Dalgaard
Carsten Jaeger wrote:
 Hello Peter,

 thanks for your help. I'm quite sure that I specified the right model.
 Factor C is indeed nested within factor A. I think you were confused by
 the numbering of C (1..11), and it is easier to understand when I code
 it as you suggested (1,2,3 within each level of A, as in mydata1 [see
 below]). However, it does not matter which numbering I choose for
 carrying the analysis, as

 anova(lm(resp ~ A * B + (C %in% A), mydata))
 anova(lm(resp ~ A * B + (C %in% A), mydata1))

 both give the same results (as at least I had expected because of the
 nesting).

 However, I found that Anova() from the car package only accepts the
 second version. So,

 Anova(lm(resp ~ A * B + (C %in% A), mydata)) does not work (giving an
 error) but
 Anova(lm(resp ~ A * B + (C %in% A), mydata1)) does.

 This behaviour is rather confusing, or is there anything I'm missing?

   
You're not listening to what I told you!

A term C %in% A  (or A/C) is not a _specification_ that C is nested in
A, it is a _directive_ to include the terms A and C:A. Now, C:A involves
a term for each combination of A and C, of which many are empty if C is
strictly coarser than A. This may well be what is confusing Anova().

In fact, with this (c(1:3,6:11)) coding of C, A:C is completely
equivalent to C, but if you look at summary(lm()) you will see a lot
of NA coefficients in the A:C case. If you use resp ~ A*B+C, then you
still get a couple of missing coefficients in the C terms because of
collinearity with the A terms. (Notice that this is one case where the
order inside the model formula will matter; C+A*B is not the same.)

Whether you'd want C as a random factor is a different matter. It is
often the natural model if C is subject and A is group. Let's assume
that this is the case: In an ordinary linear model, you can test whether
you can remove C (or A:C) , which implies that all subjects in the same
group have the same level of the response. In your case, the hypothesis
is accepted, but the F statistic is around 3 (on (6, 6) DF) , which
suggests that there might be some variation of subjects within groups.
In a mixed-effects model, you assume that this variation exists and
therefore you use the SSD for C as the denominator when testing A, which
is arguably safer than pooling it with the somewhat smaller residual SSD.

 Thanks for your help again, 

 Carsten


 R mydata
   A B  C resp
 1 1 1  1 34.12
 2 1 1  2 32.45
 3 1 1  3 44.55
 4 1 2  1 20.88
 5 1 2  2 22.32
 6 1 2  3 27.71
 7 2 1  6 38.20
 8 2 1  7 31.62
 9 2 1  8 38.71
 102 2  6 18.93
 112 2  7 20.57
 122 2  8 31.55
 133 1  9 40.81
 143 1 10 42.23
 153 1 11 41.26
 163 2  9 28.41
 173 2 10 24.07
 183 2 11 21.16

 R mydata1
   A B  C resp
 1 1 1  1 34.12
 2 1 1  2 32.45
 3 1 1  3 44.55
 4 1 2  1 20.88
 5 1 2  2 22.32
 6 1 2  3 27.71
 7 2 1  1 38.20
 8 2 1  2 31.62
 9 2 1  3 38.71
 102 2  1 18.93
 112 2  2 20.57
 122 2  3 31.55
 133 1  1 40.81
 143 1  2 42.23
 153 1  3 41.26
 163 2  1 28.41
 173 2  2 24.07
 183 2  3 21.16


 On Tue, 2007-07-10 at 13:54 +0200, Peter Dalgaard wrote:
   
 Carsten Jaeger wrote:
 
 Hello,

 is it possible to obtain type III sums of squares for a nested model as
 in the following:

 lmod - lm(resp ~ A * B + (C %in% A), mydata))

 I have tried

 library(car)
 Anova(lmod, type=III)

 but this gives me an error (and I also understand from the documentation
 of Anova as well as from a previous request
 (http://finzi.psych.upenn.edu/R/Rhelp02a/archive/64477.html) that it is
 not possible to specify nested models with car's Anova).

 anova(lmod) works, of course.

 My data (given below) is balanced so I expect the results to be similar
 for both type I and type III sums of squares. But are they *exactly* the
 same? The editor of the journal which I'm sending my manuscript to
 requests what he calls conventional type III tests and I'm not sure if
   
 can convince him to accept my type I analysis.
   
 In balanced designs, type I-IV SSD's are all identical. However, I don't 
 think the model does what I think you think it does. 

 Notice that nesting is used with two diferent meanings, in R it would be 
 that the codings of C only makes sense within levels of A - e.g. if they 
 were numbered 1:3 within each group, but with C==1 when A==1 having nothing 
 to do with C==1 when A==2.  SAS does something. er. else...

 What I think you want is a model where C is a random terms so that main 
 effects of A can be tested, like in

 
 summary(aov(resp ~ A * B + Error(C), dd))
   
 

Re: [R] elementary statistics with R (rkward?)

2007-07-11 Thread Chuck Cleland
Christopher W. Ryan wrote:
 As a fellow beginner, I also found Handbook of Statistical Analyses
 Using R, by Brian Everitt, to be a very useful book.  There is an
 accompanying R package, HSAUR.
 
 Also Using R for Introductory Statistics, by John Verzani.  There is an
 accompanying R package, UsingR.

  And for Peter Dalgaard's book there is the ISwR package:

http://cran.r-project.org/src/contrib/Descriptions/ISwR.html

 Christopher W. Ryan, MD
 SUNY Upstate Medical University Clinical Campus at Binghamton
 40 Arch Street, Johnson City, NY  13790
 cryanatbinghamtondotedu
 PGP public keys available at http://home.stny.rr.com/ryancw/
 
 If you want to build a ship, don't drum up the men to gather wood,
 divide the work and give orders. Instead, teach them to yearn for the
 vast and endless sea.  [Antoine de St. Exupery]
 
 Charles Annis, P.E. wrote:
 Face the music and buy the book: _Introductory Statistics with R_ by Peter
 Dalgaard.  It's perfect for what you need.  It's clear and concise and will
 teach you statistics AND R as painlessly as such a thing can be.  It's
 inexpensive and you can get it on Amazon.com and every other major
 bookseller, including the nearest university bookstore.

 Charles Annis, P.E.

 [EMAIL PROTECTED]
 phone: 561-352-9699
 eFax:  614-455-3265
 http://www.StatisticalEngineering.com
  
 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of Donatas G.
 Sent: Wednesday, July 11, 2007 9:27 AM
 To: r-help@stat.math.ethz.ch
 Subject: [R] elementary statistics with R (rkward?)

 Hi, I am trying to learn some basic statistics stuff but I cannot find any
 elementary statistics exercises using R language. Using RKward would be even
 better...

 I need that in analysing sociological data, obtained through questionnairres
 -
 findind corelations between variables, relations between different types of
 data, etc.

 Could anyone recommend simple tutorials/exercises, available on www for me
 to
 work on?

 I realize it would be much simple to do this introductory stuff with spss,
 that
 everyone around me is using here in Lithuania, but I'd really like to learn
 to
 do it with R instead...

 
 __
 R-help@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
 and provide commented, minimal, self-contained, reproducible code.

-- 
Chuck Cleland, Ph.D.
NDRI, Inc.
71 West 23rd Street, 8th floor
New York, NY 10010
tel: (212) 845-4495 (Tu, Th)
tel: (732) 512-0171 (M, W, F)
fax: (917) 438-0894

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] p-value from survreg(), library(survival)

2007-07-11 Thread Marc Schwartz
On Wed, 2007-07-11 at 16:41 +0200, hadley wickham wrote:
 On 7/11/07, Marc Schwartz [EMAIL PROTECTED] wrote:
  Actually, in this case, looking at the code for:
 
survival:::print.survreg
 
  would be better, as the p value is calculate there, rather than being
  part of the survreg object. As with many R functions, the p value is
  calculated in the print method for the object.
 
 I wish print methods wouldn't do that. Printing is supposed to be
 about displaying existing create, not creating new values.
 
 Hadley

It has been occasionally confusing and I am not sure of the history
behind the diverse approach. To borrow a phrase from the DoD TCSEC
books[1], I don't have my S/R Rainbow Books at hand to research it.
Both sets of colors are on shelves in my home office.

The first time I came across this years ago, was with the p value for
the F statistic in a simple linear model. it is calculated in:

  stats:::print.summary.lm

while the individual term p values are calculated in

  summary.lm

versus being part of the returned lm object itself.

I have just become behaviorally modified to look in more than one
place for such things...  :-)

Regards,

Marc

[1] http://en.wikipedia.org/wiki/Rainbow_Series

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] 3D plot and interactive PDFs

2007-07-11 Thread Bruno C\.
Thanks vito 

I was aware of movie15 but the point is how to get a U3D or VRLM file out of R 
:/
I don't know those two standards, nor I know the usual format for R 3D plots ...
And unfortunately I am a bit in a rush so no way, right now, to do some reverse 
engineering about plot file format in order to convert them in VRLM :D

 This does not answer exactly to your question, anyway..:
 
 If you are planning to use latex, the package movie15 allows to include 
 media files in your document (to be processed via pdflatex)
 
 vito
 
 
 
 Bruno C. wrote:
  With version 8 of acrobat reader, it is now possible to have 3D in PDf 
  documents.
  Does it exist already an R package who manage to produce 3D plots which can 
  be saved as interactive 3D graphs in a PDF file?
  
  Best Regards
  Bruno Cavestro
  
  
  --
  Leggi GRATIS le tue mail con il telefonino i-modeTM di Wind
  http://i-mode.wind.it/
  
  __
  R-help@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
  and provide commented, minimal, self-contained, reproducible code.
  
  
 
 -- 
 
 Vito M.R. Muggeo
 Dip.to Sc Statist e Matem `Vianelli'
 Università di Palermo
 viale delle Scienze, edificio 13
 90128 Palermo - ITALY
 tel: 091 6626240
 fax: 091 485726/485612
 
 


--
Leggi GRATIS le tue mail con il telefonino i-mode™ di Wind
http://i-mode.wind.it/

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


[R] tkfocus issue

2007-07-11 Thread Hao Liu
Dear All:

I am stuck with this issue:

I have a button on a TK window, once click it, it pops up a individual 
plot device:

 individual_plot - function() {
 tkconfigure(overlay.button, state=normal)
options(locatorBell = FALSE)
 plotfuntype()
 trellis.focus(panel, 1, 1,highlight=FALSE)
 panel.identify(labels=colnames(dataplot))
}

Now I have another button, originally state=disabled, but activated by 
: tkconfigure(overlay.button, state=normal) in previous function:

The overlay function was writen to overlay another plot to the original 
plot.

--The problem:

1.once the plot device is out, I can't go back to the Tk window, it 
is take hostage by the plot image some how. As a result, overlay button 
won't work.

2. Is there a mechanism to detect close/destroy of the plotting device 
in R? I want to use that even to make overlay.button state to disabled 
so user won't be able to click overlay just to get an error message if 
there is no plot already exist...


Thanks
Hao

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] exces return by mktcap decile for each year

2007-07-11 Thread jim holtman
here is one way of doing it using 'ave':

 dat - read.table(textConnection(mc yrret
+  32902.233 01/01/1995  0.426
+  15793.691 01/01/1995  0.024
+   2375.868 01/01/1995  0.660
+  54586.558 01/01/1996  0.497
+  10674.900 01/01/1996  0.405
+859.656 01/01/1996 -0.033
+770.963 01/01/1995 -1.248
+423.480 01/01/1995  0.654
+   2135.504 01/01/1995  0.394
+696.599 01/01/1995 -0.482
+   5115.476 01/01/1995  0.352
+821.347 01/01/1995  0.869
+  43329.695 01/01/1995  0.495
+   7975.151 01/01/1995  0.112
+396.450 01/01/1995  0.956
+843.870 01/01/1995  0.172
+   2727.037 01/01/1995 -0.358
+114.584 01/01/1995 -1.015
+   1347.327 01/01/1995 -0.083
+   4592.049 01/01/1995 -0.251
+674.305 01/01/1995 -0.327
+  39424.887 01/01/1996  0.198
+   4447.383 01/01/1996 -0.045
+   1608.540 01/01/1996 -0.109
+217.151 01/01/1996  0.539
+   1813.320 01/01/1996  0.754
+145.170 01/01/1996  0.249
+   3176.298 01/01/1996 -0.202
+  14379.686 01/01/1996  0.013
+   3009.059 01/01/1996 -0.328
+   1781.406 01/01/1996 -0.158
+   2576.215 01/01/1996  0.514
+   1236.317 01/01/1996  0.346
+   3003.735 01/01/1996  0.151
+   1544.003 01/01/1996  0.482
+   7588.657 01/01/1996  0.306
+   1516.625 01/01/1996  0.183
+   1596.098 01/01/1996  0.674
+   2792.192 01/01/1996  0.528
+   1276.702 01/01/1996  0.010
+875.716 01/01/1996  0.189
+   4858.450 01/01/1995  0.250
+   2033.623 01/01/1995 -0.582
+   2164.125 01/01/1995  0.631), header=TRUE)
 # quantiles by year (need as grouping in next statement
 dat$qByYr - ave(dat$mc, dat$yr, FUN=function(x){
+ cut(x, quantile(x, prob=seq(0, 1, .1)), include.lowest=TRUE)
+ })
 # compute the mean for year/quantile
 dat$dec.mean - ave(dat$ret, dat$yr, dat$qByYr, FUN=mean)
 # mean adjusted return
 dat$mean.adjusted - dat$ret - dat$dec.mean
 dat
  mc yrret qByYr   dec.mean mean.adjusted
1  32902.233 01/01/1995  0.42610  0.4605000  -0.03450
2  15793.691 01/01/1995  0.024 9  0.068  -0.04400
3   2375.868 01/01/1995  0.660 6  0.6455000   0.01450
4  54586.558 01/01/1996  0.49710  0.236   0.26100
5  10674.900 01/01/1996  0.405 9  0.3555000   0.04950
6859.656 01/01/1996 -0.033 1  0.2516667  -0.28467
7770.963 01/01/1995 -1.248 3 -0.1895000  -1.05850
8423.480 01/01/1995  0.654 1  0.198   0.45567
9   2135.504 01/01/1995  0.394 5 -0.094   0.48800
10   696.599 01/01/1995 -0.482 2 -0.4045000  -0.07750
11  5115.476 01/01/1995  0.352 8  0.301   0.05100
12   821.347 01/01/1995  0.869 3 -0.1895000   1.05850
13 43329.695 01/01/1995  0.49510  0.4605000   0.03450
14  7975.151 01/01/1995  0.112 9  0.068   0.04400
15   396.450 01/01/1995  0.956 1  0.198   0.75767
16   843.870 01/01/1995  0.172 4  0.0445000   0.12750
17  2727.037 01/01/1995 -0.358 7 -0.3045000  -0.05350
18   114.584 01/01/1995 -1.015 1  0.198  -1.21333
19  1347.327 01/01/1995 -0.083 4  0.0445000  -0.12750
20  4592.049 01/01/1995 -0.251 7 -0.3045000   0.05350
21   674.305 01/01/1995 -0.327 2 -0.4045000   0.07750
22 39424.887 01/01/1996  0.19810  0.236  -0.03800
23  4447.383 01/01/1996 -0.045 8 -0.1235000   0.07850
24  1608.540 01/01/1996 -0.109 5  0.162  -0.27133
25   217.151 01/01/1996  0.539 1  0.2516667   0.28733
26  1813.320 01/01/1996  0.754 5  0.162   0.59167
27   145.170 01/01/1996  0.249 1  0.2516667  -0.00267
28  3176.298 01/01/1996 -0.202 8 -0.1235000  -0.07850
29 14379.686 01/01/1996  0.01310  0.236  -0.22300
30  3009.059 01/01/1996 -0.328 7 -0.0885000  -0.23950
31  1781.406 01/01/1996 -0.158 5  0.162  -0.32033
32  2576.215 01/01/1996  0.514 6  0.521  -0.00700
33  1236.317 01/01/1996  0.346 2  0.2675000   0.07850
34  3003.735 01/01/1996  0.151 7 -0.0885000   0.23950
35  1544.003 01/01/1996  0.482 4  0.578  -0.09600
36  7588.657 01/01/1996  0.306 9  0.3555000  -0.04950
37  1516.625 01/01/1996  0.183 3  0.0965000   0.08650
38  1596.098 01/01/1996  0.674 4  0.578   0.09600
39  2792.192 01/01/1996  0.528 6  0.521   0.00700
40  1276.702 01/01/1996  0.010 3  0.0965000  -0.08650
41   875.716 01/01/1996  0.189 2  0.2675000  -0.07850
42  4858.450 01/01/1995  0.250 8  0.301  -0.05100
43  2033.623 01/01/1995 -0.582 5 -0.094  -0.48800
44  2164.125 01/01/1995  0.631 6  0.6455000  -0.01450





On 7/11/07, Frank Hansen [EMAIL PROTECTED] wrote:
 Hi Jim,

 Thanks for getting back on this. I did not see your
 email on the help list. I or you can post this
 solution

 You are right I mis-stated about mc. mc is real, it is
 yr that is a factor.

 Here is a solution, which works, but it is clunky. I
 thought there might be a better/more R-like less
 for-loop way to 

Re: [R] Power calculation for the time series experiment

2007-07-11 Thread Greg Snow

The built in power functions are for the fairly straight forward
situations.  Yours does not appear to fit into any of those.  You need
to think through your problem a bit more before starting to think about
power.

What do you mean by effect size of 1.5 (is that 1.5 standard deviations?
Or raw units? What is the SD?  Is the effect of 1.5 the same at each
time point? Or would it change?)

How do you plan on analyzing the data?  Manova? Lme?

What do you expect the correlation structure to be?

I would suggest creating a dataset that represents the structure that
you expect (includes the time points, treatment group, and any thing
else).  Then fill in the response with random data (rnorm to start,
mvrnorm may be useful for the correlated part).  Now analyze this data
with the tool you plan to use to make sure that it works and gives the
expected output.

Now take the code you used above and create a function or set of lines
such that it is easy to change things like the overall sample size, the
correlation(s), the SD and/or effect size.  Have the result of the
function or code be the p-value of interest.

Now use the replicate function to run this code/function a bunch of
times, the number of times that the p-value is less than your alpha is
your estimate of the power for that set of conditions.  Now change some
conditions (sample size, correlation, ...) and repeate.

Hope this helps,

-- 
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
[EMAIL PROTECTED]
(801) 408-8111
 
 

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of A Ezhil
 Sent: Wednesday, July 11, 2007 8:15 AM
 To: r-help@stat.math.ethz.ch
 Subject: [R] Power calculation for the time series experiment
 
 Hi All,
 
 We are planning to run an experiment, where samples will be 
 taken at different time points (say, 0, 4, 8, 16, 24). If I 
 am interested in the effect size of 1.5 for a reasonably 
 large samples (say 500), what will be the power? Is it a good 
 idea to use F-test (one-way
 ANOVA) as my test statistics?  How can we include correlation 
 structure among samples in the power analysis, if I use 
 one-way ANOVA design? 
 
 I am aware of power.anova.test() in R that will help me to do 
 power calculation for one-way ANOVA.  It will be of great 
 help if you send me some related articles or pointers to some 
 useful resources.
 
 Thanks in advance.
 
 Kind regards,
 Ezhil
 
 __
 R-help@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
 and provide commented, minimal, self-contained, reproducible code.


__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] survfit for interval censored data

2007-07-11 Thread Cody Hamilton
Sandra,

As far as I am aware, you will have to use a parametric model (survreg) if your 
survival times are interval-censored.

Regards,
   -Cody

Cody Hamilton
Edwards Lifesciences

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sandra Ellis
Sent: Wednesday, July 11, 2007 7:11 AM
To: r-help@stat.math.ethz.ch
Subject: [R] survfit for interval censored data

pHello,/ppI am a new R-user and would like to use survfit for interval 
censored data.
Whenever I try I get an error message that states I can only use survfit for 
right censored or
counting process data.  I was wondering if anyone knows if there is an 
additional package available
that can calculate KM curves for interval censored data, or another program 
with this
capability?/ppThank you./ppS. Ellis (student)/p

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


[R] Drawing rectangles in multiple panels

2007-07-11 Thread Jonathan Williams
Hi folks,

I'm having some trouble understanding the intricacies of panel 
functions.  I wish to create three side-by-side graphs, each with 
different data-- so far, so good: I rbind() the data, add a column of 
subscripts as a conditioning variable, load up the lattice package, 
specify either a c(3,1) 'layout' or work through 'allow.multiple' and 
'outer' and I'm good to go.

But now I wish to add three rectangles to each plot, which will be in 
different places on each panel, and I'm terribly stuck.  I can guess 
this requires defining a panel function on the fly, but none of my 
attempts are working.  Suggestions?

Thanks much, - Jonathan

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Drawing rectangles in multiple panels

2007-07-11 Thread deepayan . sarkar
On 7/11/07, Jonathan Williams [EMAIL PROTECTED] wrote:
 Hi folks,

 I'm having some trouble understanding the intricacies of panel
 functions.  I wish to create three side-by-side graphs, each with
 different data-- so far, so good: I rbind() the data, add a column of
 subscripts as a conditioning variable, load up the lattice package,
 specify either a c(3,1) 'layout' or work through 'allow.multiple' and
 'outer' and I'm good to go.

 But now I wish to add three rectangles to each plot, which will be in
 different places on each panel, and I'm terribly stuck.  I can guess
 this requires defining a panel function on the fly, but none of my
 attempts are working.  Suggestions?

You haven't told us what determines the rectangles (only that they are
different in each panel). If they are completely driven by panel data,
here's an example:

panel.qrect -
function(x, y, ...)
{
xq - quantile(x, c(0.1, 0.9))
yq - quantile(y, c(0.1, 0.9))
panel.rect(xq[1], yq[1], xq[2], yq[2],
   col = grey86, border = NA)
panel.xyplot(x, y, ...)
}

xyplot(Sepal.Length ~ Sepal.Width | Species, iris,
   panel = panel.qrect)

If the rectangles are somehow determined externally, you probably want
to use one of the accessor functions described in help(panel.number).
There are good and bad (i.e. less robust) ways to use these, but we
need to know your use case before recommending one.

-Deepayan

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] error using lp function in linux

2007-07-11 Thread Byran Smucker


Perhaps I should clarify that when I use sample code from the lp help
function, I can paste it and run it in my windows-based R with no
problems.  My question is why the same code won't work on a linux
system.

Thanks,
Byran Smucker



On Wed, 11 Jul 2007 12:00:09 +0200  r-help@stat.math.ethz.ch wrote:




Message: 56
Date: Tue, 10 Jul 2007 19:07:10 -0400
From: quot;Byran Smuckerquot; [EMAIL PROTECTED]
Subject: [R] error using lp function in linux
To: r-help@stat.math.ethz.ch
Message-ID: [EMAIL PROTECTED]
Content-Type: text/plain



Hello all,

I would like to use the lp function (lpSolve package) on a linux system.  Using
sample code from the lp function help, I can solve the linear program with no
errors or problems.  However, when I copy the exact same code to R in linux
(after loading the lpSolve package), I get the following error:


 *** caught segfault ***
address 0x3, cause 'memory not mapped'

Traceback:
 1: .C(quot;lpslinkquot;, direction = as.integer(direction), x.count =

as.integer(x.count), objective = as.double(objective), const.count = 
as.integer(const.count), constraints = as.double(constraints), int.count 
= as.integer(int.count), int.vec = as.integer(int.vec), objval = 
as.double(objval), solution = as.double(solution), presolve = 
as.integer(presolve), compute.sens = as.integer(compute.sens), 
sens.coef.from = as.double(sens.coef.from), sens.coef.to = 
as.double(sens.coef.to), duals = as.double(duals), duals.from = 
as.double(duals.from), duals.to = as.double(duals.to), status = 
as.integer(status), PACKAGE = quot;lpSolvequot;)
 2: lp(quot;maxquot;, f.obj, f.con, f.dir, f.rhs)

Possible actions:
1: abort (with core dump, if enabled)
2: normal R exit
3: exit R without saving workspace
4: exit R saving workspace
 Does this function not work with linux or is there some other
explanation?Thanks,
Byran Smucker

Graduate Student, Dept. of Statistics

Penn State University

301 Thomas Building




[[alternative HTML version deleted]]

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Drawing rectangles in multiple panels

2007-07-11 Thread Jonathan Williams
Deepayan,

Thanks for the clarification.  The rectangles are completely external 
to the panel data, and correspond to 90% confidence intervals built 
from training data, to be overlaid on these graphs of the test data.

- Jonathan

At 10:04 AM 7/11/2007, you wrote:
On 7/11/07, Jonathan Williams [EMAIL PROTECTED] wrote:
Hi folks,

I'm having some trouble understanding the intricacies of panel
functions.  I wish to create three side-by-side graphs, each with
different data-- so far, so good: I rbind() the data, add a column of
subscripts as a conditioning variable, load up the lattice package,
specify either a c(3,1) 'layout' or work through 'allow.multiple' and
'outer' and I'm good to go.

But now I wish to add three rectangles to each plot, which will be in
different places on each panel, and I'm terribly stuck.  I can guess
this requires defining a panel function on the fly, but none of my
attempts are working.  Suggestions?

You haven't told us what determines the rectangles (only that they are
different in each panel). If they are completely driven by panel data,
here's an example:

panel.qrect -
function(x, y, ...)
{
xq - quantile(x, c(0.1, 0.9))
yq - quantile(y, c(0.1, 0.9))
panel.rect(xq[1], yq[1], xq[2], yq[2],
   col = grey86, border = NA)
panel.xyplot(x, y, ...)
}

xyplot(Sepal.Length ~ Sepal.Width | Species, iris,
   panel = panel.qrect)

If the rectangles are somehow determined externally, you probably want
to use one of the accessor functions described in help(panel.number).
There are good and bad (i.e. less robust) ways to use these, but we
need to know your use case before recommending one.

-Deepayan

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Drawing rectangles in multiple panels

2007-07-11 Thread Bert Gunter
Deepayan et. al.:

A question/comment: I have usually found that the subscripts argument is
what I need when passing *external* information into the panel function, for
example, when I wish to add results from a fit done external to the trellis
call. Fits[subscripts] gives me the fits (or whatever) I want to plot for
each panel. It is not clear to me how the panel layout information from
panel.number(), etc. would be helpful here instead. Am I correct? -- or is
there a smarter way to do this that I've missed?

Cheers,

Bert

Bert Gunter
Genentech Nonclinical Statistics


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
[EMAIL PROTECTED]
Sent: Wednesday, July 11, 2007 10:04 AM
To: Jonathan Williams
Cc: r-help@stat.math.ethz.ch
Subject: Re: [R] Drawing rectangles in multiple panels

On 7/11/07, Jonathan Williams [EMAIL PROTECTED] wrote:
 Hi folks,

 I'm having some trouble understanding the intricacies of panel
 functions.  I wish to create three side-by-side graphs, each with
 different data-- so far, so good: I rbind() the data, add a column of
 subscripts as a conditioning variable, load up the lattice package,
 specify either a c(3,1) 'layout' or work through 'allow.multiple' and
 'outer' and I'm good to go.

 But now I wish to add three rectangles to each plot, which will be in
 different places on each panel, and I'm terribly stuck.  I can guess
 this requires defining a panel function on the fly, but none of my
 attempts are working.  Suggestions?

You haven't told us what determines the rectangles (only that they are
different in each panel). If they are completely driven by panel data,
here's an example:

panel.qrect -
function(x, y, ...)
{
xq - quantile(x, c(0.1, 0.9))
yq - quantile(y, c(0.1, 0.9))
panel.rect(xq[1], yq[1], xq[2], yq[2],
   col = grey86, border = NA)
panel.xyplot(x, y, ...)
}

xyplot(Sepal.Length ~ Sepal.Width | Species, iris,
   panel = panel.qrect)

If the rectangles are somehow determined externally, you probably want
to use one of the accessor functions described in help(panel.number).
There are good and bad (i.e. less robust) ways to use these, but we
need to know your use case before recommending one.

-Deepayan

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


[R] How to load permtest package

2007-07-11 Thread amna khan
Hi sir

Sir I am not understanding how to load permtest on R console for windows?

Regards


-- 
AMINA SHAHZADI
Department of Statistics
GC University Lahore, Pakistan.
Email:
[EMAIL PROTECTED]
[EMAIL PROTECTED]
[EMAIL PROTECTED]

[[alternative HTML version deleted]]

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


[R] aov() question

2007-07-11 Thread Leigh E Alexander
Hi all,
So I think I have seen some similar questions to mine when I searched  
the archives, but have not seen any concrete answers and was  
wondering if any one could help.
I have been trying to use R's aov() function to analyze my data.  I  
have a 3 x 4 x 2 repeated measures design.  All of the IVs are within  
subjects.I do also have missing values (unequal N), as I have to  
remove any incorrect trials for each subject.

Here is the code I entered and the error message:

a-aov(log(rt)~(tran*block*half) + Error (sid/ (tran*block*half)),  
data=mydata2)

Warning message:
Error() model is singular in: aov(log(rt) ~ (tran * block * half) +  
Error(sid/(tran * block *

I then do summary(a) and am able to get an output, but I am not sure  
whether or not I can trust that output since I got the error message.
Any body have any thoughts/solutions for this?

Also, are there any benefits of you aov() vs. use some of the linear  
model functions or vice versa?

Thanks for any help you can offer!!

~Leigh Alexander

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Drawing rectangles in multiple panels

2007-07-11 Thread deepayan . sarkar
On 7/11/07, Bert Gunter [EMAIL PROTECTED] wrote:
 Deepayan et. al.:

 A question/comment: I have usually found that the subscripts argument is
 what I need when passing *external* information into the panel function, for
 example, when I wish to add results from a fit done external to the trellis
 call. Fits[subscripts] gives me the fits (or whatever) I want to plot for
 each panel. It is not clear to me how the panel layout information from
 panel.number(), etc. would be helpful here instead. Am I correct? -- or is
 there a smarter way to do this that I've missed?

subscripts is absolutely the right thing to use if your auxiliary
information is in the form of vectors than have the same length as the
rest of your data. Examples would include a color for every point in a
xyplot or confidence bounds in a dotplot. However, sometimes your
external information might be a summary; say the parameters defining a
fitted curve for every combination of your conditioning variables (and
the underlying model might have shared information across
combinations, so you wouldn't be able to compute them from the panel
data alone). In that case, which.packet(), which gives you the levels
of the conditioning variables defining the current panel, may be
helpful.

Of course, there are workarounds using subscripts, or in this example,
adding rows to your data frame containing the fitted values. The
accessors are a convenience that sometimes make life simpler.

-Deepayan

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Drawing rectangles in multiple panels

2007-07-11 Thread deepayan . sarkar
On 7/11/07, Jonathan Williams [EMAIL PROTECTED] wrote:
 Deepayan,

 Thanks for the clarification.  The rectangles are completely external
 to the panel data, and correspond to 90% confidence intervals built
 from training data, to be overlaid on these graphs of the test data.

Right. So if you have that information in a single object (say a
list), you can specify that as an argument to xyplot (or whatever),
and capture that in the panel function to then index it. E.g.


rectInfo -
list(matrix(runif(4), 2, 2),
 matrix(runif(4), 2, 2),
 matrix(runif(4), 2, 2))


panel.qrect -
function(x, y, ..., rect.info)
{
ri - rect.info[[packet.number()]]
## if you have more than one conditioning variable, this might be
## something like
## ri - do.call([, list(rect.info, as.list(which.packet([[1]]
panel.rect(ri[1, 1], ri[1, 2], ri[2, 1], ri[2, 2],
   col = grey86, border = NA)
panel.xyplot(x, y, ...)
}


xyplot(runif(30) ~ runif(30) | gl(3, 10),
   rect.info = rectInfo,
   panel = panel.qrect)

-Deepayan

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


[R] system: Linux vs. Windows differences

2007-07-11 Thread Alberto Monteiro
[I tried to send this messages two days ago, but I guess I mistyped the To: 
address...]

Why system is different in Linux and Windows? Both in R 2.4.1, but in 
Windows there is an option:

  system(something, wait = FALSE)

while on Linux (Fedora Core 4), there is no such option?

Alberto Monteiro

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Drawing rectangles in multiple panels

2007-07-11 Thread hadley wickham
 A question/comment: I have usually found that the subscripts argument is
 what I need when passing *external* information into the panel function, for
 example, when I wish to add results from a fit done external to the trellis
 call. Fits[subscripts] gives me the fits (or whatever) I want to plot for
 each panel. It is not clear to me how the panel layout information from
 panel.number(), etc. would be helpful here instead. Am I correct? -- or is
 there a smarter way to do this that I've missed?

This is one of things that I think ggplot does better - it's much
easier to plot multiple data sources.  I don't have many examples of
this yet, but the final example on
http://had.co.nz/ggplot2/geom_abline.html illustrates the basic idea.

For the original poster ggplot2 isn't that much more convenient,
because there isn't a built in rectangle geom (although it would be
trivial to add one).  You could use the more general polygon geom,
http://had.co.nz/ggplot2/geom_polygon.html, however it currently
doesn't have a lot of documentation.

Hadley

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] system: Linux vs. Windows differences

2007-07-11 Thread Marc Schwartz
On Wed, 2007-07-11 at 16:16 -0200, Alberto Monteiro wrote:
 [I tried to send this messages two days ago, but I guess I mistyped the To: 
 address...]
 
 Why system is different in Linux and Windows? Both in R 2.4.1, but in 
 Windows there is an option:
 
   system(something, wait = FALSE)
 
 while on Linux (Fedora Core 4), there is no such option?
 
 Alberto Monteiro

From:

  https://svn.r-project.org/R/trunk/NEWS

for changes in R 2.5.0:

o   system() now takes the same set of arguments on all platforms,
with those which are not applicable being ignored with a
warning.  Unix-alikes gain 'input' and 'wait', and Windows
gains 'ignore.stderr'.


Time to upgrade both your R and your FC installation.  

R is at 2.5.1.

FC4 has been EOL (End of Life) for some time and FC5 hit EOL last month.

HTH,

Marc Schwartz

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


[R] Stepwise GLM selection by LRT?

2007-07-11 Thread Lutz Ph. Breitling
Dear List,

having searched the help and archives, I have the impression that
there is no automatic model selection procedure implemented in R that
includes/excludes predictors in logistic regression models based on
LRT P-values. Is that true, or is someone aware of an appropriate
function somewhere in a custom package?

Even if automatic model selection and LRT might not be the most
appropriate methods, I actually would like to use these in order to
simulate someone else's modeling approach...

Many thanks for all comments-
Lutz
-
Lutz Ph. Breitling
German Cancer Research Center
Heidelberg/Germany

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Stepwise GLM selection by LRT?

2007-07-11 Thread Ravi Varadhan
Check out the stepAIC function in MASS package.  This is a nice tool, where
you can actually implement any penalty even though the function's name has
AIC in it because it is the default.  Although this doesn't do an LRT test
based variable selection, you can sort of approximate it by using a penalty
of k = qchisq(1-p, df=1), where p is the p-value for variable selection.
This penalty means that a variable enters/exits an existing model, when the
absolute value of change in log-likelihood is greater than qchisq(1-p,
df=1). For p = 0.1, k = 2.71, and for p=0.05, k = 3.84.  Is this whhant
you'd like to do?
 
Ravi.


---

Ravi Varadhan, Ph.D.

Assistant Professor, The Center on Aging and Health

Division of Geriatric Medicine and Gerontology 

Johns Hopkins University

Ph: (410) 502-2619

Fax: (410) 614-9625

Email: [EMAIL PROTECTED]

Webpage:  http://www.jhsph.edu/agingandhealth/People/Faculty/Varadhan.html

 





-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Lutz Ph. Breitling
Sent: Wednesday, July 11, 2007 3:06 PM
To: r-help@stat.math.ethz.ch
Subject: [R] Stepwise GLM selection by LRT?

Dear List,

having searched the help and archives, I have the impression that
there is no automatic model selection procedure implemented in R that
includes/excludes predictors in logistic regression models based on
LRT P-values. Is that true, or is someone aware of an appropriate
function somewhere in a custom package?

Even if automatic model selection and LRT might not be the most
appropriate methods, I actually would like to use these in order to
simulate someone else's modeling approach...

Many thanks for all comments-
Lutz
-
Lutz Ph. Breitling
German Cancer Research Center
Heidelberg/Germany

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


[R] How to get weekly Co-Variance

2007-07-11 Thread Felipe Carrillo
Hi: I am trying to migrate from Systat to R but I am facing my first challenge. 
While I easily can get weekly co-variance for my data, I can't seem to 
acomplish this with R ( I can't figure out how is done) If interested in 
looking a sample of my data, please check the Excel attachment. In Systat from 
Week 28 I get a covariance of 1055 fish.
  Thanks in advance


Felipe D. Carrillo
  Fishery Biologist
  US Fish  Wildlife Service
  Red Bluff, California 96080

   
-
__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


[R] make error R-5.1 on sun solaris

2007-07-11 Thread Dan Powers
I hope this is enough information to determine the problem. Thanks in
advance for any help.

Configure goes ok (I think)

./configure --prefix=$HOME --without-iconv


R is now configured for sparc-sun-solaris2.9

  Source directory:  .
  Installation directory:/home/dpowers

  C compiler:gcc  -g -O2
  Fortran 77 compiler:   f95  -g

  C++ compiler:  g++  -g -O2
  Fortran 90/95 compiler:f95 -g
  Obj-C compiler: -g -O2

  Interfaces supported:  X11
  External libraries:readline
  Additional capabilities:   NLS
  Options enabled:   shared BLAS, R profiling, Java

  Recommended packages:  yes

Make ends after the gcc..

make
.
.
.

gcc -I. -I../../src/include -I../../src/include -I/usr/openwin/include
-I/usr/local/include -DHAVE_CONFIG_H   -g -O2 -c system.c -o system.o
system.c: In function `Rf_initialize_R':
system.c:144: parse error before `char'
system.c:216: `localedir' undeclared (first use in this function)
system.c:216: (Each undeclared identifier is reported only once
system.c:216: for each function it appears in.)
*** Error code 1
make: Fatal error: Command failed for target `system.o'
Current working directory /home/dpowers/R-2.5.1/src/unix
*** Error code 1
make: Fatal error: Command failed for target `R'
Current working directory /home/dpowers/R-2.5.1/src/unix
*** Error code 1
make: Fatal error: Command failed for target `R'
Current working directory /home/dpowers/R-2.5.1/src
*** Error code 1
make: Fatal error: Command failed for target `R'


I have tried setting localedir directly in configure options, but get the
same error.

Any ideas?

Thanks,
Dan
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Daniel A. Powers, Ph.D.
Department of Sociology
University of Texas at Austin
1 University Station A1700
Austin, TX  78712-0118
phone: 512-232-6335
fax:   512-471-1748
[EMAIL PROTECTED]

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] system: Linux vs. Windows differences

2007-07-11 Thread Ted Harding
On 11-Jul-07 18:28:19, Marc Schwartz wrote:
 On Wed, 2007-07-11 at 16:16 -0200, Alberto Monteiro wrote:
 [I tried to send this messages two days ago, but I guess I mistyped
 the To: 
 address...]
 
 Why system is different in Linux and Windows? Both in R 2.4.1, but
 in 
 Windows there is an option:
 
   system(something, wait = FALSE)
 
 while on Linux (Fedora Core 4), there is no such option?
 
 Alberto Monteiro
 
 From:
 
   https://svn.r-project.org/R/trunk/NEWS
 
 for changes in R 2.5.0:
 
 o system() now takes the same set of arguments on all platforms,
   with those which are not applicable being ignored with a
   warning.  Unix-alikes gain 'input' and 'wait', and Windows
   gains 'ignore.stderr'.
 
 
 Time to upgrade both your R and your FC installation.  
 
 R is at 2.5.1.
 
 FC4 has been EOL (End of Life) for some time and FC5 hit EOL last
 month.
 
 HTH,
 
 Marc Schwartz

End of Life is a Nomenklatura categorisation.

While we loyal Members welcome and applaud President-2.5.1,
we do not forget old Comrades now air-brushed from the photographs
who, now faceless, sturdily labour 24 hours a day in the fields
and saltmines, and even in the dark attics of those who conceal
and protect them still.

There can be life in old dogs, and even strong teeth in some.

Ted.
[emailing from SuSE-5.2 (1997), logged in from Red Hat 9 (2003)]


E-Mail: (Ted Harding) [EMAIL PROTECTED]
Fax-to-email: +44 (0)870 094 0861
Date: 11-Jul-07   Time: 22:32:13
-- XFMail --

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] make error R-5.1 on sun solaris

2007-07-11 Thread Peter Dalgaard
Dan Powers wrote:
 I hope this is enough information to determine the problem. Thanks in
 advance for any help.

 Configure goes ok (I think)

 ./configure --prefix=$HOME --without-iconv


 R is now configured for sparc-sun-solaris2.9

   Source directory:  .
   Installation directory:/home/dpowers

   C compiler:gcc  -g -O2
   Fortran 77 compiler:   f95  -g

   C++ compiler:  g++  -g -O2
   Fortran 90/95 compiler:f95 -g
   Obj-C compiler: -g -O2

   Interfaces supported:  X11
   External libraries:readline
   Additional capabilities:   NLS
   Options enabled:   shared BLAS, R profiling, Java

   Recommended packages:  yes

 Make ends after the gcc..

 make
 .
 .
 .

 gcc -I. -I../../src/include -I../../src/include -I/usr/openwin/include
 -I/usr/local/include -DHAVE_CONFIG_H   -g -O2 -c system.c -o system.o
 system.c: In function `Rf_initialize_R':
 system.c:144: parse error before `char'
 system.c:216: `localedir' undeclared (first use in this function)
 system.c:216: (Each undeclared identifier is reported only once
 system.c:216: for each function it appears in.)
 *** Error code 1
 make: Fatal error: Command failed for target `system.o'
 Current working directory /home/dpowers/R-2.5.1/src/unix
 *** Error code 1
 make: Fatal error: Command failed for target `R'
 Current working directory /home/dpowers/R-2.5.1/src/unix
 *** Error code 1
 make: Fatal error: Command failed for target `R'
 Current working directory /home/dpowers/R-2.5.1/src
 *** Error code 1
 make: Fatal error: Command failed for target `R'


 I have tried setting localedir directly in configure options, but get the
 same error.

 Any ideas?

   
Hmm, which version of gcc is this? The problem seems to be around line 
144 which reads

140 Rstart Rp = rstart;
141 cmdlines[0] = '\0';
142 
143 #ifdef ENABLE_NLS
144 char localedir[PATH_MAX+20];
145 #endif
146 
147 #if defined(HAVE_SYS_RESOURCE_H)  defined(HAVE_GETRLIMIT)
148 {
149 struct rlimit rlim;


I seem to remember that it used to be non-kosher to mix declarations 
and ordinary code like that, but the current compiler doesn't seem to 
care (I do have #define ENABLE_NLS 1 in Rconfig.h, as I assume you do 
too). Could you perhaps try moving line 141 down below #endif?



 Thanks,
 Dan
 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Daniel A. Powers, Ph.D.
 Department of Sociology
 University of Texas at Austin
 1 University Station A1700
 Austin, TX  78712-0118
 phone: 512-232-6335
 fax:   512-471-1748
 [EMAIL PROTECTED]

 __
 R-help@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
 and provide commented, minimal, self-contained, reproducible code.


__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] system: Linux vs. Windows differences

2007-07-11 Thread Marc Schwartz
On Wed, 2007-07-11 at 22:32 +0100, [EMAIL PROTECTED] wrote:
 On 11-Jul-07 18:28:19, Marc Schwartz wrote:
  On Wed, 2007-07-11 at 16:16 -0200, Alberto Monteiro wrote:
  [I tried to send this messages two days ago, but I guess I mistyped
  the To: 
  address...]
  
  Why system is different in Linux and Windows? Both in R 2.4.1, but
  in 
  Windows there is an option:
  
system(something, wait = FALSE)
  
  while on Linux (Fedora Core 4), there is no such option?
  
  Alberto Monteiro
  
  From:
  
https://svn.r-project.org/R/trunk/NEWS
  
  for changes in R 2.5.0:
  
  o system() now takes the same set of arguments on all platforms,
with those which are not applicable being ignored with a
warning.  Unix-alikes gain 'input' and 'wait', and Windows
gains 'ignore.stderr'.
  
  
  Time to upgrade both your R and your FC installation.  
  
  R is at 2.5.1.
  
  FC4 has been EOL (End of Life) for some time and FC5 hit EOL last
  month.
  
  HTH,
  
  Marc Schwartz
 
 End of Life is a Nomenklatura categorisation.
 
 While we loyal Members welcome and applaud President-2.5.1,
 we do not forget old Comrades now air-brushed from the photographs
 who, now faceless, sturdily labour 24 hours a day in the fields
 and saltmines, and even in the dark attics of those who conceal
 and protect them still.
 
 There can be life in old dogs, and even strong teeth in some.
 
 Ted.
 [emailing from SuSE-5.2 (1997), logged in from Red Hat 9 (2003)]

Wow...  :-)

I am envisioning the above as the Prologue for a book...I am feeling
suddenly melancholy...   

I whole heartily nominate this as a fortune!

Regards,

Marc

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Drawing rectangles in multiple panels

2007-07-11 Thread Deepayan Sarkar
On 7/11/07, hadley wickham [EMAIL PROTECTED] wrote:
  A question/comment: I have usually found that the subscripts argument is
  what I need when passing *external* information into the panel function, for
  example, when I wish to add results from a fit done external to the trellis
  call. Fits[subscripts] gives me the fits (or whatever) I want to plot for
  each panel. It is not clear to me how the panel layout information from
  panel.number(), etc. would be helpful here instead. Am I correct? -- or is
  there a smarter way to do this that I've missed?

 This is one of things that I think ggplot does better - it's much
 easier to plot multiple data sources.  I don't have many examples of
 this yet, but the final example on
 http://had.co.nz/ggplot2/geom_abline.html illustrates the basic idea.

That's probably true. The Trellis approach is to define a plot by
data source + type of plot, whereas the ggplot approach (if I
understand correctly) is to create a specification for the display
(incrementally?) and then render it. Since the specification can be
very general, the approach is very flexible. The downside is that you
need to learn the language.

On a philosophical note, I think the apparent limitations of Trellis
in some (not all) cases is just due to the artificial importance given
to data frames as the one true container for data. Now that we have
proper multiple dispatch in S4, we can write methods that behave like
traditional Trellis calls but work with more complex data structures.
We have tried this in one bioconductor package (flowViz) with
encouraging results.

-Deepayan

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] type III ANOVA for a nested linear model

2007-07-11 Thread Richard Rowe
Mark Difford wrote:
 Indeed!  And, apropos of the expression, to be Ripleyed (and so be
 condemned to eating cookies for a long, long time), what about being
 Billasted?

 BestR,
 Mark.


 Simon Blomberg-4 wrote:
   
 I second the nomination!

 Simon.

 On Tue, 2007-07-10 at 10:02 -0600, Greg Snow wrote:
 
 I nominate the following 2 pieces from Bill's reply for fortunes
 (probably 2 separate fortunes):
  


   
 All this becomes even more glaring if you take the unusal 
 step of plotting the data.
 
 and

   
 What sort of editor would overlook this clear and 
 demonstrable message leaping out from the data in favour of 
 some arcane argument about types of sums of squares?  
 Several answers come to mind: A power freak, a SAS 
 afficianado, an idiot.
 
More seriously on this topic is the need to educate editors. Few editors 
in the biological field (real biology, biomed etc) appear to have, or if 
they have, to exercise, any sort of near current judgment on statistical 
methods, techniques or interpretations. Referees often have no knowledge 
of analysis and editors blindly back their referee ... (my own pet gripe 
here is being asked for replicates when showing the existence of a 
phenomenon ... The assertion 'all swans are black' is refuted by the 
observation of a white swan ... Referee: how many replicates did the 
researcher have? There appears to be a single sample here; where is the 
confidence interval on the proportion of white swans?).

A little learning is a dangerous thing ... (Pope) ... and most 
biological editors may have a compulsory undergraduate subject in their 
distant background, from which they remember 'Yates' correction' and 'no 
cell with fewer than 5 observations' (sic),

Richard Rowe

-- 
Dr Richard Rowe
Zoology  Tropical Ecology
School of Tropical Biology
James Cook University
Townsville 4811
AUSTRALIA

ph +61 7 47 81 4851
fax +61 7 47 25 1570
JCU has CRICOS Provider Code 00117J

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


[R] rgdal memory error for a small map.

2007-07-11 Thread Milton Cezar Ribeiro
Dear all,

I am trying to read a - almost for me - small map on R using rgdal package. 
This image have dimension of 1701x1401 and are stored on native ArcGis GRID 
format. When I see the files sizes, it is less then one megabyte. But 
unfortunately when I try read using readGDAL function it return a memory.size() 
error. I don´t know why it occours, if it is a small map. Below you can see 
GDALinfo(), readGDAL() = with the error, sessionInfo() and memory.size() 
outputs.

Any idea?

Kind regards,

miltinho
Brazil

 GDALinfo('al001_frag')
Closing GDAL dataset handle 0x0134d310...  destroyed ... done.
rows1701 
columns 1401 
bands   1 
ll.x0.5 
ll.y1701.5 
res.x   1 
res.y   1 
oblique.x   0 
oblique.y   0 
driver  AIG 
projection  NA 
fileal001_frag 
 tst-readGDAL(al001_frag)
al001_frag has GDAL driver AIG 
and has 1701 rows and 1401 columns
Closing GDAL dataset handle 0x020d7c68...  destroyed ... done.
Warning messages:
1: Reached total allocation of 479Mb: see help(memory.size) 
2: Reached total allocation of 479Mb: see help(memory.size) 
 *
 sessionInfo()
R version 2.5.0 (2007-04-23) 
i386-pc-mingw32 
locale:
LC_COLLATE=English_Jamaica.1252;LC_CTYPE=English_Jamaica.1252;LC_MONETARY=English_Jamaica.1252;LC_NUMERIC=C;LC_TIME=English_Jamaica.1252
attached base packages:
[1] stats graphics  grDevices utils datasets  methods  
[7] base 
other attached packages:
   rgdal   sp 
0.5-13 0.9-14 
 memory.size()
[1] 218914992


   


http://yahoo.com.br/oqueeuganhocomisso 
[[alternative HTML version deleted]]

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Drawing rectangles in multiple panels

2007-07-11 Thread Stephen Tucker
Not that Trellis/lattice was entirely easy to learn at first. :)

I've been playing around with ggplot2 and there is a plot()-like wrapper for
building a quick plot [incidentally, called qplot()], but otherwise it's my
understanding that you superpose elements (incrementally) to build up to the
graph you want. Here is the same plot in ggplot2:

rectInfo -
list(matrix(runif(4), 2, 2),
 matrix(runif(4), 2, 2),
 matrix(runif(4), 2, 2))

library(ggplot2)
ggopt(grid.fill = white) # just my preference
## original plot of points
p -
qplot(x,y,data=data.frame(x=runif(30),y=runif(30),f=gl(3,30)),facets=f~.)
# print(p)

## external data (rectangles) - in coordinates for geom_polygon 
x - do.call(rbind,
 mapply(function(.r,.f)
data.frame(x=.r[c(1,1,2,2),1],y=.r[c(1,2,2,1),2],f=.f),
.r=rectInfo,.f=seq(along=rectInfo),SIMPLIFY=FALSE))
## add rectangle to original plot of points
p+layer(geom=polygon,data=x,mapping=aes(x=x,y=y),facets=f~.)
# will print the graphics on my windows() device

Though lattice does seem to emphasize the 'chart type' approach to graphing,
in a way I see that it provides a similar flexibility - just that the
specifications for each element are contained in functions and objects that
are ultimately invoked by a high-level/higher-order function, instead of
being combined in the linear fashion of ggplot2.

ST

--- Deepayan Sarkar [EMAIL PROTECTED] wrote:

 On 7/11/07, hadley wickham [EMAIL PROTECTED] wrote:
   A question/comment: I have usually found that the subscripts argument
 is
   what I need when passing *external* information into the panel
 function, for
   example, when I wish to add results from a fit done external to the
 trellis
   call. Fits[subscripts] gives me the fits (or whatever) I want to plot
 for
   each panel. It is not clear to me how the panel layout information from
   panel.number(), etc. would be helpful here instead. Am I correct? -- or
 is
   there a smarter way to do this that I've missed?
 
  This is one of things that I think ggplot does better - it's much
  easier to plot multiple data sources.  I don't have many examples of
  this yet, but the final example on
  http://had.co.nz/ggplot2/geom_abline.html illustrates the basic idea.
 
 That's probably true. The Trellis approach is to define a plot by
 data source + type of plot, whereas the ggplot approach (if I
 understand correctly) is to create a specification for the display
 (incrementally?) and then render it. Since the specification can be
 very general, the approach is very flexible. The downside is that you
 need to learn the language.
 
 On a philosophical note, I think the apparent limitations of Trellis
 in some (not all) cases is just due to the artificial importance given
 to data frames as the one true container for data. Now that we have
 proper multiple dispatch in S4, we can write methods that behave like
 traditional Trellis calls but work with more complex data structures.
 We have tried this in one bioconductor package (flowViz) with
 encouraging results.
 
 -Deepayan
 
 __
 R-help@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
 and provide commented, minimal, self-contained, reproducible code.
 



  


__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Drawing rectangles in multiple panels

2007-07-11 Thread Stephen Tucker
In the Trellis approach, another way (I like) to deal with multiple pieces of
external data sources is to 'attach' them to panel functions through lexical
closures. For instance...

rectInfo -
list(matrix(runif(4), 2, 2),
 matrix(runif(4), 2, 2),
 matrix(runif(4), 2, 2))

panel.qrect - function(rect.info) {
  function(x, y, ...) {
ri - rect.info[[packet.number()]]
panel.rect(ri[1, 1], ri[1, 2], ri[2, 1], ri[2, 2],
   col = grey86, border = NA)
panel.xyplot(x, y, ...)
  }
}

xyplot(runif(30) ~ runif(30) | gl(3, 10),
   panel = panel.qrect(rectInfo))

...which may or may not be more convenient than passing rectInfo (and perhaps
other objects if desired) explicitly as an argument to xyplot().


--- Deepayan Sarkar [EMAIL PROTECTED] wrote:

 On 7/11/07, hadley wickham [EMAIL PROTECTED] wrote:
   A question/comment: I have usually found that the subscripts argument
 is
   what I need when passing *external* information into the panel
 function, for
   example, when I wish to add results from a fit done external to the
 trellis
   call. Fits[subscripts] gives me the fits (or whatever) I want to plot
 for
   each panel. It is not clear to me how the panel layout information from
   panel.number(), etc. would be helpful here instead. Am I correct? -- or
 is
   there a smarter way to do this that I've missed?
 
  This is one of things that I think ggplot does better - it's much
  easier to plot multiple data sources.  I don't have many examples of
  this yet, but the final example on
  http://had.co.nz/ggplot2/geom_abline.html illustrates the basic idea.
 
 That's probably true. The Trellis approach is to define a plot by
 data source + type of plot, whereas the ggplot approach (if I
 understand correctly) is to create a specification for the display
 (incrementally?) and then render it. Since the specification can be
 very general, the approach is very flexible. The downside is that you
 need to learn the language.
 
 On a philosophical note, I think the apparent limitations of Trellis
 in some (not all) cases is just due to the artificial importance given
 to data frames as the one true container for data. Now that we have
 proper multiple dispatch in S4, we can write methods that behave like
 traditional Trellis calls but work with more complex data structures.
 We have tried this in one bioconductor package (flowViz) with
 encouraging results.
 
 -Deepayan
 
 __
 R-help@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
 and provide commented, minimal, self-contained, reproducible code.


__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Drawing rectangles in multiple panels

2007-07-11 Thread Deepayan Sarkar
On 7/11/07, Stephen Tucker [EMAIL PROTECTED] wrote:
 In the Trellis approach, another way (I like) to deal with multiple pieces of
 external data sources is to 'attach' them to panel functions through lexical
 closures. For instance...

 rectInfo -
 list(matrix(runif(4), 2, 2),
  matrix(runif(4), 2, 2),
  matrix(runif(4), 2, 2))

 panel.qrect - function(rect.info) {
   function(x, y, ...) {
 ri - rect.info[[packet.number()]]
 panel.rect(ri[1, 1], ri[1, 2], ri[2, 1], ri[2, 2],
col = grey86, border = NA)
 panel.xyplot(x, y, ...)
   }
 }

 xyplot(runif(30) ~ runif(30) | gl(3, 10),
panel = panel.qrect(rectInfo))

 ...which may or may not be more convenient than passing rectInfo (and perhaps
 other objects if desired) explicitly as an argument to xyplot().

That's an interesting approach. I think the important thing is to make
sure that the data required to reproduce the plot is available as part
of the trellis object (e.g. if you save it and load it in another
session (not that anyone actually ever does that, but it's the
principle of the thing)). This happens transparently if you supply the
external data as arguments to xyplot(). It happens in your example
too, but the data is hidden inside the environment of the panel
function. The two approaches might differ in terms of memory use, but
I'm not sure.

-Deepayan

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Drawing rectangles in multiple panels

2007-07-11 Thread Gabor Grothendieck
Your approach of using closures is cleaner than that
given below but just for comparison in:

http://tolstoy.newcastle.edu.au/R/devel/06/03/4476.html

there is a createWrapper function which creates a new function based
on the function passed as its first argument by using the components
of the list passed as its second argument to overwrite its formal
arguments.  For example,

createWrapper - function(FUN, Params) {
   as.function(c(replace(formals(FUN), names(Params), Params), body(FUN)))
}

library(lattice)

rectInfo -
   list(matrix(runif(4), 2, 2),
matrix(runif(4), 2, 2),
matrix(runif(4), 2, 2))


panel.qrect - function(x, y, ..., rect.info) {
   ri - rect.info[[packet.number()]]
   panel.rect(ri[1, 1], ri[1, 2], ri[2, 1], ri[2, 2],
  col = grey86, border = NA)
   panel.xyplot(x, y, ...)
}

xyplot(runif(30) ~ runif(30) | gl(3, 10),
  panel = createWrapper(panel.qrect, list(rect.info = rectInfo)))

The createWrapper approach does have an advantage in the situation
where the function analogous to panel.qrect is existing since using
scoping then involves manipulation of environments in the closure
approach.

On 7/11/07, Stephen Tucker [EMAIL PROTECTED] wrote:
 In the Trellis approach, another way (I like) to deal with multiple pieces of
 external data sources is to 'attach' them to panel functions through lexical
 closures. For instance...

 rectInfo -
list(matrix(runif(4), 2, 2),
 matrix(runif(4), 2, 2),
 matrix(runif(4), 2, 2))

 panel.qrect - function(rect.info) {
  function(x, y, ...) {
ri - rect.info[[packet.number()]]
panel.rect(ri[1, 1], ri[1, 2], ri[2, 1], ri[2, 2],
   col = grey86, border = NA)
panel.xyplot(x, y, ...)
  }
 }

 xyplot(runif(30) ~ runif(30) | gl(3, 10),
   panel = panel.qrect(rectInfo))

 ...which may or may not be more convenient than passing rectInfo (and perhaps
 other objects if desired) explicitly as an argument to xyplot().


 --- Deepayan Sarkar [EMAIL PROTECTED] wrote:

  On 7/11/07, hadley wickham [EMAIL PROTECTED] wrote:
A question/comment: I have usually found that the subscripts argument
  is
what I need when passing *external* information into the panel
  function, for
example, when I wish to add results from a fit done external to the
  trellis
call. Fits[subscripts] gives me the fits (or whatever) I want to plot
  for
each panel. It is not clear to me how the panel layout information from
panel.number(), etc. would be helpful here instead. Am I correct? -- or
  is
there a smarter way to do this that I've missed?
  
   This is one of things that I think ggplot does better - it's much
   easier to plot multiple data sources.  I don't have many examples of
   this yet, but the final example on
   http://had.co.nz/ggplot2/geom_abline.html illustrates the basic idea.
 
  That's probably true. The Trellis approach is to define a plot by
  data source + type of plot, whereas the ggplot approach (if I
  understand correctly) is to create a specification for the display
  (incrementally?) and then render it. Since the specification can be
  very general, the approach is very flexible. The downside is that you
  need to learn the language.
 
  On a philosophical note, I think the apparent limitations of Trellis
  in some (not all) cases is just due to the artificial importance given
  to data frames as the one true container for data. Now that we have
  proper multiple dispatch in S4, we can write methods that behave like
  traditional Trellis calls but work with more complex data structures.
  We have tried this in one bioconductor package (flowViz) with
  encouraging results.
 
  -Deepayan
 
  __
  R-help@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
  and provide commented, minimal, self-contained, reproducible code.
 

 __
 R-help@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
 and provide commented, minimal, self-contained, reproducible code.


__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Drawing rectangles in multiple panels

2007-07-11 Thread Stephen Tucker
Regarding this, I meant to imply that lattice was similarly flexible in the
sense of handing multiple data sets [IMHO], in regards to other aspects of
the 'grammar of graphics' I have no qualifications to justify comment. But
the idea and intuitiveness of graph construction in ggplot2 is very appealing
- in an hour I picked up enough to do quite a bit, just by going through
examples in the author's book http://had.co.nz/ggplot2/. Will be
interesting to see how this package will be received by the community.

Stephen

--- Stephen Tucker [EMAIL PROTECTED] wrote:

 Not that Trellis/lattice was entirely easy to learn at first. :)
 
 I've been playing around with ggplot2 and there is a plot()-like wrapper
 for
 building a quick plot [incidentally, called qplot()], but otherwise it's my
 understanding that you superpose elements (incrementally) to build up to
 the
 graph you want. Here is the same plot in ggplot2:
 
 rectInfo -
 list(matrix(runif(4), 2, 2),
  matrix(runif(4), 2, 2),
  matrix(runif(4), 2, 2))
 
 library(ggplot2)
 ggopt(grid.fill = white) # just my preference
 ## original plot of points
 p -
 qplot(x,y,data=data.frame(x=runif(30),y=runif(30),f=gl(3,30)),facets=f~.)
 # print(p)
 
 ## external data (rectangles) - in coordinates for geom_polygon 
 x - do.call(rbind,
  mapply(function(.r,.f)
 data.frame(x=.r[c(1,1,2,2),1],y=.r[c(1,2,2,1),2],f=.f),
 .r=rectInfo,.f=seq(along=rectInfo),SIMPLIFY=FALSE))
 ## add rectangle to original plot of points
 p+layer(geom=polygon,data=x,mapping=aes(x=x,y=y),facets=f~.)
 # will print the graphics on my windows() device
 
 Though lattice does seem to emphasize the 'chart type' approach to
 graphing,
 in a way I see that it provides a similar flexibility - just that the
 specifications for each element are contained in functions and objects that
 are ultimately invoked by a high-level/higher-order function, instead of
 being combined in the linear fashion of ggplot2.
 
 ST
 
 --- Deepayan Sarkar [EMAIL PROTECTED] wrote:
 
  On 7/11/07, hadley wickham [EMAIL PROTECTED] wrote:
A question/comment: I have usually found that the subscripts argument
  is
what I need when passing *external* information into the panel
  function, for
example, when I wish to add results from a fit done external to the
  trellis
call. Fits[subscripts] gives me the fits (or whatever) I want to plot
  for
each panel. It is not clear to me how the panel layout information
 from
panel.number(), etc. would be helpful here instead. Am I correct? --
 or
  is
there a smarter way to do this that I've missed?
  
   This is one of things that I think ggplot does better - it's much
   easier to plot multiple data sources.  I don't have many examples of
   this yet, but the final example on
   http://had.co.nz/ggplot2/geom_abline.html illustrates the basic idea.
  
  That's probably true. The Trellis approach is to define a plot by
  data source + type of plot, whereas the ggplot approach (if I
  understand correctly) is to create a specification for the display
  (incrementally?) and then render it. Since the specification can be
  very general, the approach is very flexible. The downside is that you
  need to learn the language.
  
  On a philosophical note, I think the apparent limitations of Trellis
  in some (not all) cases is just due to the artificial importance given
  to data frames as the one true container for data. Now that we have
  proper multiple dispatch in S4, we can write methods that behave like
  traditional Trellis calls but work with more complex data structures.
  We have tried this in one bioconductor package (flowViz) with
  encouraging results.
  
  -Deepayan
  
  __
  R-help@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
  and provide commented, minimal, self-contained, reproducible code.
  
 
 
 
  


 
 __
 R-help@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
 and provide commented, minimal, self-contained, reproducible code.
 



   

Pinpoint customers who are looking for what you sell.

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Drawing rectangles in multiple panels

2007-07-11 Thread hadley wickham
On 7/12/07, Deepayan Sarkar [EMAIL PROTECTED] wrote:
 On 7/11/07, hadley wickham [EMAIL PROTECTED] wrote:
   A question/comment: I have usually found that the subscripts argument is
   what I need when passing *external* information into the panel function, 
   for
   example, when I wish to add results from a fit done external to the 
   trellis
   call. Fits[subscripts] gives me the fits (or whatever) I want to plot for
   each panel. It is not clear to me how the panel layout information from
   panel.number(), etc. would be helpful here instead. Am I correct? -- or is
   there a smarter way to do this that I've missed?
 
  This is one of things that I think ggplot does better - it's much
  easier to plot multiple data sources.  I don't have many examples of
  this yet, but the final example on
  http://had.co.nz/ggplot2/geom_abline.html illustrates the basic idea.

 That's probably true. The Trellis approach is to define a plot by
 data source + type of plot, whereas the ggplot approach (if I
 understand correctly) is to create a specification for the display
 (incrementally?) and then render it. Since the specification can be
 very general, the approach is very flexible. The downside is that you
 need to learn the language.

Yes, that's right.  ggplot basically decomposes type of plot into
statistical transformation (stat) + geometric object and allows you to
control each component separately.  ggplot also explicitly includes
the idea of layers (ie. one layer is a scatterplot and another layer
is a loess smooth) and allows you to supply different datasets to
different layers.

 On a philosophical note, I think the apparent limitations of Trellis
 in some (not all) cases is just due to the artificial importance given
 to data frames as the one true container for data. Now that we have
 proper multiple dispatch in S4, we can write methods that behave like
 traditional Trellis calls but work with more complex data structures.
 We have tried this in one bioconductor package (flowViz) with
 encouraging results.

That's one area which I haven't thought much about.  ggplot is very
data.frame centric and it's not yet clear to me how plotting a linear
model (say) would fit into the grammar.

Hadley

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Drawing rectangles in multiple panels

2007-07-11 Thread hadley wickham
On 7/12/07, Stephen Tucker [EMAIL PROTECTED] wrote:
 Not that Trellis/lattice was entirely easy to learn at first. :)

 I've been playing around with ggplot2 and there is a plot()-like wrapper for
 building a quick plot [incidentally, called qplot()], but otherwise it's my
 understanding that you superpose elements (incrementally) to build up to the
 graph you want. Here is the same plot in ggplot2:

 rectInfo -
 list(matrix(runif(4), 2, 2),
  matrix(runif(4), 2, 2),
  matrix(runif(4), 2, 2))

 library(ggplot2)
 ggopt(grid.fill = white) # just my preference
 ## original plot of points
 p -
 qplot(x,y,data=data.frame(x=runif(30),y=runif(30),f=gl(3,30)),facets=f~.)
 # print(p)

 ## external data (rectangles) - in coordinates for geom_polygon
 x - do.call(rbind,
  mapply(function(.r,.f)
 data.frame(x=.r[c(1,1,2,2),1],y=.r[c(1,2,2,1),2],f=.f),
 .r=rectInfo,.f=seq(along=rectInfo),SIMPLIFY=FALSE))
 ## add rectangle to original plot of points
 p+layer(geom=polygon,data=x,mapping=aes(x=x,y=y),facets=f~.)
 # will print the graphics on my windows() device

You should be able to simplify this line to:
p+geom_polygon(data=x)
because all the other information is already contained in the plot object.

 Though lattice does seem to emphasize the 'chart type' approach to graphing,
 in a way I see that it provides a similar flexibility - just that the
 specifications for each element are contained in functions and objects that
 are ultimately invoked by a high-level/higher-order function, instead of
 being combined in the linear fashion of ggplot2.

I tend to think in very data centric approach, where you first
generate the data (in a data frame) and then you plot it.  There is
very little data creation/modification during the plotting itself - I
think this is different to lattice, where you often do more data
manipulation in the panel function itself.  I don't think one is
better or worse, just different.

Hadley

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Drawing rectangles in multiple panels

2007-07-11 Thread hadley wickham
On 7/12/07, Stephen Tucker [EMAIL PROTECTED] wrote:
 In the Trellis approach, another way (I like) to deal with multiple pieces of
 external data sources is to 'attach' them to panel functions through lexical
 closures. For instance...

 rectInfo -
 list(matrix(runif(4), 2, 2),
  matrix(runif(4), 2, 2),
  matrix(runif(4), 2, 2))

 panel.qrect - function(rect.info) {
   function(x, y, ...) {
 ri - rect.info[[packet.number()]]
 panel.rect(ri[1, 1], ri[1, 2], ri[2, 1], ri[2, 2],
col = grey86, border = NA)
 panel.xyplot(x, y, ...)
   }
 }

 xyplot(runif(30) ~ runif(30) | gl(3, 10),
panel = panel.qrect(rectInfo))

 ...which may or may not be more convenient than passing rectInfo (and perhaps
 other objects if desired) explicitly as an argument to xyplot().

This is an interesting approach.  The one problem I see with it is
that if you change the trellising specification, you have to change
your rectInfo datastructure.  I guess we're missing the code that
actually generates rectInfo in the first place, so maybe in practice
it's not such a big problem.

Hadley

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


[R] Subsetting problem

2007-07-11 Thread Cressoni, Massimo (NIH/NHLBI) [F]
I need to perform the Exact Wilcoxon Mann-Whitney on a subset of my database.
Assuming that IPPO is my data frame and IPPOBIS is the subset my variable still
have 3 different levels and the function wilcox_test (package coin)
does not accept it. 
I do not know how to overcome this problem.

ippo - c(rep(A,10),rep(B,10),rep(C,10))
ippo2 - c(rnorm(10,0,1),rnorm(10,10,10),rnorm(10,10,10))
IPPO - data.frame(ippo,ippo2)

IPPOBIS - IPPO[IPPO$ippo == A | IPPO$ippo == B,]

wilcox_test(ippo2 ~ ippo,data=IPPOBIS,distribution=exact())
Error in check(itp) : 'object' does not represent a two sample problem
levels(IPPOBIS$ippo)
[1] A B C

Massimo Cressoni

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] make error R-5.1 on sun solaris

2007-07-11 Thread Prof Brian Ripley
You are asked for a C99 compiler and configure normally finds one: mixing 
declarations and code is valid C99.

Unless something has been done with environment variables (e.g. in 
config.site) this gcc is very old.  configure should come up with 
'gcc -std=gnu99'.  Re-ordering the code will help (but it may need to go 
below the next #ifdef block too), but a gcc update would be a very good 
idea as gcc on Sparc has been buggy up to about 3.4.x.

Note too that --without-iconv is undesirable and should not be necessary 
as libiconv can be installed as a preload on Solaris (8 and 10, so 
presumably also 9).


On Thu, 12 Jul 2007, Peter Dalgaard wrote:

 Dan Powers wrote:
 I hope this is enough information to determine the problem. Thanks in
 advance for any help.

 Configure goes ok (I think)

 ./configure --prefix=$HOME --without-iconv


 R is now configured for sparc-sun-solaris2.9

   Source directory:  .
   Installation directory:/home/dpowers

   C compiler:gcc  -g -O2
   Fortran 77 compiler:   f95  -g

   C++ compiler:  g++  -g -O2
   Fortran 90/95 compiler:f95 -g
   Obj-C compiler: -g -O2

   Interfaces supported:  X11
   External libraries:readline
   Additional capabilities:   NLS
   Options enabled:   shared BLAS, R profiling, Java

   Recommended packages:  yes

 Make ends after the gcc..

 make
 .
 .
 .

 gcc -I. -I../../src/include -I../../src/include -I/usr/openwin/include
 -I/usr/local/include -DHAVE_CONFIG_H   -g -O2 -c system.c -o system.o
 system.c: In function `Rf_initialize_R':
 system.c:144: parse error before `char'
 system.c:216: `localedir' undeclared (first use in this function)
 system.c:216: (Each undeclared identifier is reported only once
 system.c:216: for each function it appears in.)
 *** Error code 1
 make: Fatal error: Command failed for target `system.o'
 Current working directory /home/dpowers/R-2.5.1/src/unix
 *** Error code 1
 make: Fatal error: Command failed for target `R'
 Current working directory /home/dpowers/R-2.5.1/src/unix
 *** Error code 1
 make: Fatal error: Command failed for target `R'
 Current working directory /home/dpowers/R-2.5.1/src
 *** Error code 1
 make: Fatal error: Command failed for target `R'


 I have tried setting localedir directly in configure options, but get the
 same error.

 Any ideas?


 Hmm, which version of gcc is this? The problem seems to be around line
 144 which reads

 140 Rstart Rp = rstart;
 141 cmdlines[0] = '\0';
 142
 143 #ifdef ENABLE_NLS
 144 char localedir[PATH_MAX+20];
 145 #endif
 146
 147 #if defined(HAVE_SYS_RESOURCE_H)  defined(HAVE_GETRLIMIT)
 148 {
 149 struct rlimit rlim;


 I seem to remember that it used to be non-kosher to mix declarations
 and ordinary code like that, but the current compiler doesn't seem to
 care (I do have #define ENABLE_NLS 1 in Rconfig.h, as I assume you do
 too). Could you perhaps try moving line 141 down below #endif?



 Thanks,
 Dan
 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Daniel A. Powers, Ph.D.
 Department of Sociology
 University of Texas at Austin
 1 University Station A1700
 Austin, TX  78712-0118
 phone: 512-232-6335
 fax:   512-471-1748
 [EMAIL PROTECTED]

 __
 R-help@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
 and provide commented, minimal, self-contained, reproducible code.


 __
 R-help@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
 and provide commented, minimal, self-contained, reproducible code.


-- 
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

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


[R] ggplot2 / reshape / Question on manipulating data

2007-07-11 Thread Pete Kazmier
I'm an R newbie but recently discovered the ggplot2 and reshape
packages which seem incredibly useful and much easier to use for a
beginner.  Using the data from the IMDB, I'm trying to see how the
average movie rating varies by year.  Here is what my data looks like:

 ratings - read.delim(groomed.list, header = TRUE, sep = |, comment.char 
 = )
 ratings - subset(ratings, VoteCount  100)
 head(ratings)
 Title  Histogram VoteCount VoteMean Year
1!Huff (2004) (TV) 16   299  8.4 2004
8  'Allo 'Allo! (1982) 000125   829  8.6 1982
50  .hack//SIGN (2002) 001113   150  7.0 2002
561-800-Missing (2003) 000103   118  5.4 2003
66  Greatest Artists (2000) (mini) 00..16   110  7.8 2000
77 00 Scariest Movie (2004) (mini) 00..000115   256  8.6 2004

The above data is not aggregated.  So after playing around with basic
R functionality, I stumbled across the 'aggregate' function and was
able to see the information in the manner I desired (average movie
rating by year).

 byYear - aggregate(ratings$VoteMean, list(Year = ratings$Year), mean)
 plot(byYear)

Having just discovered gglot2, I wanted to create the same graph but
augment it with a color attribute based on the total number of votes
in a year.  So first I tried to see if I could reproduce the above:

 library(ggplot2)
 qplot(Year, x, byYear)

This did not work as expected because the x-axis contained labels for
each and every year making it impossible to read whereas the plot
created with basic R had nice x-axis labels.  How do I get 'qplot' to
treat the x-axis in a similar manner to 'plot'?

After playing around further, I was able to get 'qplot' to work in a
manner similar to 'plot' with regards to the x-axis labels by using
'melt' and 'cast'.  The 'qplot' now behaves correctly:

 mratings - melt(ratings, id = c(Title, Year), measure = c(VoteCount, 
 VoteMean))
 byYear2 - cast(mratings, Year ~ variable, mean, subset = variable == 
 VoteMean)
 qplot(Year, VoteMean, data = byYear2)

How do 'byYear' and 'byYear2' differ?  I am trying to use 'typeof' but
both seem to be lists.  However, they are clearly different in some
way because 'qplot' graphs them differently.

Finally, I'd like to use a color attribute to 'qplot' to augment each
point with a color based on the total number of votes for the year.
Using attributes with 'qplot' seems simple, but I'm having a hard time
grooming my data appropriately.  I believe this requires aggregation
by summing the VoteCount column.  Is there a way to cast the data
using different aggregation functions for various columns?  In my
case, I want the mean of the VoteMean column, and the sum of the
VoteCount column.  Then I want to produce a graph showing the average
movie rating per year but with each point colored to reflect the total
number of votes for that year.  Any pointers?

Thanks,
Pete

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Subsetting problem

2007-07-11 Thread Prof Brian Ripley
You have three levels of factor 'ippo' and data on two.  That is not a 
two-sample problem, as the error message says. Try

IPPOBIS$ippo - IPPOBIS$ippo[drop=TRUE]

And please use an informative subject line (see the posting guide).

On Thu, 12 Jul 2007, Cressoni, Massimo (NIH/NHLBI) [F] wrote:

 I need to perform the Exact Wilcoxon Mann-Whitney on a subset of my database.
 Assuming that IPPO is my data frame and IPPOBIS is the subset my variable 
 still
 have 3 different levels and the function wilcox_test (package coin)
 does not accept it.
 I do not know how to overcome this problem.

 ippo - c(rep(A,10),rep(B,10),rep(C,10))
 ippo2 - c(rnorm(10,0,1),rnorm(10,10,10),rnorm(10,10,10))
 IPPO - data.frame(ippo,ippo2)

 IPPOBIS - IPPO[IPPO$ippo == A | IPPO$ippo == B,]

 wilcox_test(ippo2 ~ ippo,data=IPPOBIS,distribution=exact())
 Error in check(itp) : 'object' does not represent a two sample problem
 levels(IPPOBIS$ippo)
 [1] A B C

 Massimo Cressoni

 __
 R-help@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
 and provide commented, minimal, self-contained, reproducible code.


-- 
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

__
R-help@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
and provide commented, minimal, self-contained, reproducible code.