Re: [R] Overlapping grid in plot

2005-01-16 Thread Robin Gruna
Ok, here is some sample code to my problem

 barplot(c(1,2,4,3,2), legend.text = Legend)
 grid()

..the lines are crossing my barchart :-(...


- Original Message - 
From: Duncan Murdoch [EMAIL PROTECTED]
To: r-help@stat.math.ethz.ch
Sent: Sunday, January 16, 2005 12:33 AM
Subject: Re: [R] Overlapping grid in plot


 On Sat, 15 Jan 2005 23:02:25 +, Robin Gruna
 [EMAIL PROTECTED] wrote :

 Hi,
 I want to create a barchart plot with a grid. The grid is overlapping my
 plot and legend, looking not very nice. How can I put the grid into the
 background of my plot?

 You should show some sample code to illustrate the problem.  There are
 several ways to draw a bar chart; how to fix yours depends on which
 one you used.

 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


__
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


Re: [R] Centered variables and mixed-model

2005-01-16 Thread Douglas Bates
Martin Julien wrote:
I work in biology and I use mixed-model for my data analysis 
In a scientific paper, the author wrote: 
All continuous exploratory variables were centred on their median value
prior to inclusion in the analysis (Pinheiro  Bates, 2000).
They refer to the book Mixed-effects model in S and S-Plus by Pinheiro et
Bates in 2000.
I feel a bit strange with that paper because I can't find in the book why
they centred the variables on their median.
So I have two question:
First, is it correct to centred the variables on their median in a
mixed-model?
Second, why they do that?
Well I don't recall Pinheiro and Bates saying that variables needed to 
be centered on their median.  It is often the case that the conditioning 
of the numerical optimization for obtaining parameter estimates is 
improved if explanatory variables are centered in some way but I don't 
know of a particular reason for centering on the median.  Also, as Bert 
Gunter pointed out, this statement is about the explanatory variables 
and not a response variable.

With any statistical model, centering of variables results in a 
reparameterization of the model and one must keep this in mind when 
performing statistical tests.

__
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


Re: [R] Overlapping grid in plot

2005-01-16 Thread Duncan Murdoch
On Sun, 16 Jan 2005 10:05:01 +0100, Robin Gruna
[EMAIL PROTECTED] wrote :

Ok, here is some sample code to my problem

 barplot(c(1,2,4,3,2), legend.text = Legend)
 grid()

..the lines are crossing my barchart :-(...

The reason for this is the way R thinks of graphics, essentially as
ways to put ink on paper.  You draw the grid on top of the existing
plot.

Getting it to look the way you want is a little tricky:  you want to
draw the grid first so the bars appear on top, but R won't know how to
draw the grid until it has drawn the plot.  So the solution is to draw
the plot twice, e.g.

barplot(c(1,2,4,3,2), legend.text = Legend)
grid(col='black', lty='solid')

oldpar - par(bg='white') 
# this says to use a solid white background 
# instead of the default one, which is usually transparent.  The
# old colour is saved in oldpar

par(new=T) 
# this says to overwrite the plot

barplot(c(1,2,4,3,2), legend.text = Legend)
par(oldpar) # restore the old colour

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


Re: [R] graphing of Princomp object

2005-01-16 Thread Erik Norvelle
Tobias,
Great, works like a charm!  I'm already seeing all kinds of patterns 
that were invisible before.  I appreciate your help.

-Erik
On 15/01/2005, at 16:30, Tobias Verbeke wrote:
On Sat, 15 Jan 2005 15:53:18 +0100
List account [EMAIL PROTECTED] wrote:
Thanks, Tobias for the response.
I tried the suggestion you gave, and apparently (at least according to
the biplot manpage, only the first two members of the col vector are
used, the first to plot the first set of values, i.e. the scores, and
the second color is used for the loadings (I think I have that right).
At any rate, if I add the clause 'col = c(rep(red, 100), rep(blue,
17), rep(green, 62))' I just get a bunch of red points! :(
You're right. I'm sorry I did not read ?biplot, but only checked it had
a col argument (Semel in anno licet insanire..).
Anyway, with PCA it is not a good idea to plot both variables and
cases on one single plot, because the temptation is too great to 
interpret
proximities between variables and cases. You'd better plot two 
different
graphs, one for the cases and one for the `circle of correlations'.

For plotting the cases, you could make up your own plot using
something similar to this:
library(MASS) # for eqscplot
F1 - yourpca$score[,1]
F2 - yourpca$score[,2]
eqscplot(F1, F2, pch = 20)
text(F1, F2, labels = names(F1),
 col = c(rep(red, 100),
 rep(blue, 17),
 rep(green, 62)),
 pos = 3)
Tobias
Si vales, valeo...
-Erik
__
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

__
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


[R] Multiple plots in one screen

2005-01-16 Thread Robert Weenink
I'm a fairly new user of R and I'm confronted with a problem to which I can't 
find the solution in any R manual or FAQ.

I'd like to plot multiple 'graphs' in one plot screen. For example, my data 
frame would be:

x a  b  c
1111518
2261219
3221714

And I'd like to plot a, b and c against x at the same time in one plot screen.

How is this done?

Thanks!

Robert Weenink



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


Re: [R] Multiple plots in one screen

2005-01-16 Thread Peter Dalgaard
Robert Weenink [EMAIL PROTECTED] writes:

 I'm a fairly new user of R and I'm confronted with a problem to which I can't 
 find the solution in any R manual or FAQ.
 
 I'd like to plot multiple 'graphs' in one plot screen. For example, my data 
 frame would be:
 
 x a  b  c
 1111518
 2261219
 3221714
 
 And I'd like to plot a, b and c against x at the same time in one plot screen.
 
 How is this done?

With matplot(). There are various possibilities, e.g.

 dd - read.table(stdin(),header=TRUE)
0: x a  b  c
1: 1111518
2: 2261219
3: 3221714
4: 
 matplot(dd$x,dd[-1],type=b)

(and you don't actually need the dd$x bit because it will plot against
the index if no x is given).

-- 
   O__   Peter Dalgaard Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics 2200 Cph. N   
 (*) \(*) -- 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


Re: [R] probabilty calculation in SVM

2005-01-16 Thread David Meyer
Raj:

The references given on the help page will tell you.

Best,
David

-

Hi All,

In package e1071 for SVM based classification, one can get a probability
measure for each prediction. I like to know what is method that is used
for
calculating this probability. Is it calculated using logistic link
function?
Thanks for your help.

Regards,

Raj

__
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


Re: [R] Overlapping grid in plot

2005-01-16 Thread Marc Schwartz
On Sun, 2005-01-16 at 05:00 -0500, Duncan Murdoch wrote:
 On Sun, 16 Jan 2005 10:05:01 +0100, Robin Gruna
 [EMAIL PROTECTED] wrote :
 
 Ok, here is some sample code to my problem
 
  barplot(c(1,2,4,3,2), legend.text = Legend)
  grid()
 
 ..the lines are crossing my barchart :-(...
 
 The reason for this is the way R thinks of graphics, essentially as
 ways to put ink on paper.  You draw the grid on top of the existing
 plot.
 
 Getting it to look the way you want is a little tricky:  you want to
 draw the grid first so the bars appear on top, but R won't know how to
 draw the grid until it has drawn the plot.  So the solution is to draw
 the plot twice, e.g.
 
 barplot(c(1,2,4,3,2), legend.text = Legend)
 grid(col='black', lty='solid')
 
 oldpar - par(bg='white') 
 # this says to use a solid white background 
 # instead of the default one, which is usually transparent.  The
 # old colour is saved in oldpar
 
 par(new=T) 
 # this says to overwrite the plot
 
 barplot(c(1,2,4,3,2), legend.text = Legend)
 par(oldpar) # restore the old colour  


You can also look at the barplot2() function, which is in the 'gregmisc'
bundle on CRAN and take note of the 'plot.grid' argument, which will
enable a grid to be drawn behind the bars. As an example:

[after installing gregmisc]

library(gplots)
barplot2(c(1, 2, 4, 3, 2), legend.text = Legend,
 plot.grid = TRUE, grid.lty = solid)

This will result in horizontal lines behind the bars at the same points
as the y axis default tick marks.

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


Re: [R] CGIwithR

2005-01-16 Thread David Firth
See below for the reply I sent you when you asked me this earlier today.
David
On 16 Jan 2005, at 20:22, ebashi wrote:
Dear R users;
I'm trying to use CGIwithR on a linux machine, I have
followed the instructions on the package manual but
still it does not run,
the message that I get is as follows:
The requested URL was not found on this server
I used the example trivial, I put trivial.html under
Web directory and trivial.R in cgi-bin directory,
which itself is a subdirectory of Web directory, ( I
have changed the modes of R.cgi and .Rprofile
according to what package says) but i still get
the same message, do you have any tips for me? my
question is that where should for example myscript.R
that is mentioned in the manual, be
placed? (under Web directory or
under cgi-bin).
besides the path to R and GS, should anything else in
the R.cgi be changed?
many tanx in advance
Sean
__
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

Dear Sean
Thanks for your email.  It is hard to diagnose your problem at a 
distance, but here is some general stuff:

-- the trivial.html file needs to be in a place that is served by your 
http server (is that the URL that is not found?  ie can you see the 
form in your browser?  it wasn't clear to me from your email.)

-- your web server needs to be configured to allow CGI scripts, and 
probably to specify one or more directories where such scripts are 
allowed to live.  This is often a directory called cgi-bin; but note 
that it is not enough just to create a directory with that name, you 
must tell your webserver through its configuration file(s) that it 
exists and that CGI scripts placed there can be run.  How this is done 
depends on which HTTP server you are running, and I cannot help you 
with that I'm afraid.

-- the trivial.R, R.cgi and .Rprofile files all need to be in one of 
the places where CGI scripts are allowed (by your HTTP server) to live.

I hope that helps.  Good luck.
best wishes,
David
__
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


[R] RWinEdt install problem

2005-01-16 Thread Murray Eisenberg
I cannot get the R button to appear in RWinEdt.
I'm running R 2.0.1 under Windows XP.  I did a clean install of the 
latest WinEdt.  Previously (for an earlier installation of WinEdt) I had 
RWinEdt running OK.  Now, even though I have the distributed 
RWinEdt_1.6-2.zip extracted to the right place in the R directory, and 
when I execute

  library(RWinEdt)
in the R Console, when RWinEdt opens I do not have the R button on the 
toolbar.

How do I fix this?
In case it matters, note that I'm using a WinEdt User configuration 
(i.e., a directory that WinEdt refers to as %b) in addition to the main 
WinEdt directory (the one that WinEdt refers to as %B).

--
Murray Eisenberg [EMAIL PROTECTED]
Mathematics  Statistics Dept.
Lederle Graduate Research Tower  phone 413 549-1020 (H)
University of Massachusetts413 545-2859 (W)
710 North Pleasant Streetfax   413 545-1801
Amherst, MA 01003-9305
__
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


[R] Empirical cumulative distribution with censored data

2005-01-16 Thread Marco Chiarandini
Dear list,
I would like to plot the empirical cumulative distribution of the time 
needed by a treatment to attain a certain goal. A number of 
experiments is run with a strict time limit. In some experiments the 
goal is attained before the time limit, in other experiments time 
expires before the goal is attained. The situation is very similar to 
survivial analysis with censored data. I tryed the function:

plot(survfit(Surv(time),data=mydata,conf.int=F))
from the package survival. Nevertheless, what i would like to see is 
an increase of probability as time increases, and not a decrease of 
survival probabilty. I tried to play with ecdf(), but dealing with the 
censored data is quite hard-working in this case.

Is there anything for censored data in ecdf like-functions or a way to 
adapt plot.survfit to my case?

Thank you for consideration,
Ragards,
---
Marco Chiarandini,
Fachgebiet Intellektik, Fachbereich Informatik,
Technische Universität Darmstadt
__
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


Re: [R] Empirical cumulative distribution with censored data

2005-01-16 Thread Peter Dalgaard
Marco Chiarandini [EMAIL PROTECTED] writes:

 Dear list,
 
 I would like to plot the empirical cumulative distribution of the time
 needed by a treatment to attain a certain goal. A number of
 experiments is run with a strict time limit. In some experiments the
 goal is attained before the time limit, in other experiments time
 expires before the goal is attained. The situation is very similar to
 survivial analysis with censored data. I tryed the function:
 
 plot(survfit(Surv(time),data=mydata,conf.int=F))
 
 from the package survival. Nevertheless, what i would like to see is
 an increase of probability as time increases, and not a decrease of
 survival probabilty. I tried to play with ecdf(), but dealing with the
 censored data is quite hard-working in this case.
 
 Is there anything for censored data in ecdf like-functions or a way to
 adapt plot.survfit to my case?

Did you try the fun=event argument?


-- 
   O__   Peter Dalgaard Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics 2200 Cph. N   
 (*) \(*) -- 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


Re: [R] Empirical cumulative distribution with censored data

2005-01-16 Thread Marco Chiarandini
Peter Dalgaard wrote:
Marco Chiarandini [EMAIL PROTECTED] writes:

Dear list,
I would like to plot the empirical cumulative distribution of the time
needed by a treatment to attain a certain goal. A number of
experiments is run with a strict time limit. In some experiments the
goal is attained before the time limit, in other experiments time
expires before the goal is attained. The situation is very similar to
survivial analysis with censored data. I tryed the function:
plot(survfit(Surv(time),data=mydata,conf.int=F))
from the package survival. Nevertheless, what i would like to see is
an increase of probability as time increases, and not a decrease of
survival probabilty. I tried to play with ecdf(), but dealing with the
censored data is quite hard-working in this case.
Is there anything for censored data in ecdf like-functions or a way to
adapt plot.survfit to my case?

Did you try the fun=event argument?

Now yes.
It does what I want indeed.
Thank you a lot!
Marco
__
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


Re: [R] RWinEdt install problem

2005-01-16 Thread Uwe Ligges
Murray Eisenberg wrote:
I cannot get the R button to appear in RWinEdt.
I'm running R 2.0.1 under Windows XP.  I did a clean install of the 
latest WinEdt.  Previously (for an earlier installation of WinEdt) I had 
RWinEdt running OK.  Now, even though I have the distributed 
RWinEdt_1.6-2.zip extracted to the right place in the R directory, and 
when I execute

  library(RWinEdt)
in the R Console, when RWinEdt opens I do not have the R button on the 
toolbar.

How do I fix this?
In case it matters, note that I'm using a WinEdt User configuration 
(i.e., a directory that WinEdt refers to as %b) in addition to the main 
WinEdt directory (the one that WinEdt refers to as %B).
If you don't have write access to the WinEdt directory, you have to copy 
the R.ini file to, e.g., your local directory (%b), use the *manual* 
installation procedure as described in the ReadMe, but replace the 
command line args -e=R.ini by the full path specification, e.g.: 
-E=/path/to/%b/R.ini

In a second (apparently private mail), you told that WinEdt ... 5.4 
builds ... including the most recent one of 14 January 2005... do not 
work with the recent version of R-WinEdt, because 1. The first time, 
immediately I get a message that WinEdt.ini is corrupted and that a 
default copy (from the RWinEdt distribution I presume) is being used.

Is this version also configured to use a User configuration?
I don't have a WinEdt 5.4 version installed (still working with 5.2), 
but I will certainly take a look during the next one or two weeks.

Uwe Ligges
__
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