[R] pairs: altering pch options on upper and lower panel of pairwise scatter plots

2005-01-17 Thread Paul Hewson
Hello,

I can't figure out how to use the upper.panel and lower.panel options in
pairs to alter the label options for either panel independently of the
other.

I would like to be able to show the pairwise scatter plots for the data
as they are (a vanilla pairs plot?) but separately to be able to label
the points according to a factor level.   It is easy enough to do this
independently, but I can't figure out how to combine the two settings on
the same plot.   I have enclosed a toy example:   

Some made up data, e.g.

## make up some multivariate normal data using mvrnorm from MASS
##
require(MASS)
mu - c(0,0,0)
digma - matrix(c(0.9,0.5,0.5, 0.5,0.9,0.5, 0.5,0.5,0.9)
dummy.data - mvrnorm(100,mu,sigma)
##
## add a factor
##
gender - as.factor(c(rep(Male,50),rep(Female,50)))




I can create two separate pairs plots (upper and lower panel) as
follows:

## pairs plot just showing the data

pairs(dummy.data, lower.panel = NULL)

## pairs plot where the points are labelled according to a factor

pairs(dummy.data, pch = levels(gender), upper.panel = NULL)


But I would like to be able to combine the two panels on the same plot.
I would be grateful for any advice.   I've tried passing several
combinations of functions to upper.panel and lower.panel but either
they're the wrong function or I'm barking up the wrong tree entirely.

Thanks

Paul Hewson

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Lecturer in Statistics
University of Plymouth
Drake Circus 
Plymouth PL4 8AA

Tel ++ 44 1752 232778
Email [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


[R] 3d bar plot

2005-01-17 Thread R user
This graph - http://www.math.hope.edu/~tanis/dallas/images/disth36.gif
is an example I found at
http://www.math.hope.edu/~tanis/dallas/disth1.html
created by Maple.

Does anybody know how to create something similar in R?

I have a feeling it could be possible using scatterplot3d
(perhaps with type=h, the fourth example in help('scatterplot3d')?),
but I cannot figure it out.

Thanks in advance,
Jonne.

__
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-17 Thread Chuck Cleland
  I am using WinEdt 5.4 (Build: 20040513 (v. 5.4), on XP service pack 
2), and the following approach works for me:

1) Install RWinEdt_1.6-2.zip using RGui menus.
2) Include the following line in the Rprofile file.
library(RWinEdt)
  This will launch WinEdt with R customizations whenever RGui is launched.
hope this helps,
Chuck Cleland
Uwe Ligges wrote:
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

--
Chuck Cleland, Ph.D.
NDRI, Inc.
71 West 23rd Street, 8th floor
New York, NY 10010
tel: (212) 845-4495 (Tu, Th)
tel: (732) 452-1424 (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


[R] help wanted using R in a classroom

2005-01-17 Thread Sam Parvaneh
Hi everyone!

I'm using R 2.0.1 for Mac OS X in a classroom with 40 eMacs running Mac OS 
X version 10.3.6.
These Macs are network based, meaning that the students log in to an 
XServe G4 where their user accounts and home directories are stored.

The problem that I'm having each time a group of students (usually 7 to 
10) use R is that the whole system get incredibly slow.
The response time for opening an application  while the students are 
running R is around 5 minutes.
If a student wants to log into the system while others are running R, it 
can take up to 10 minutes for the student to get logged in.
Everything gets very slow that it's almost impossible to work.
When I look at the server Graphs, the CPU usage of the first CPU is always 
100% when these students are using R. The second CPU is left at 15%. 

When these students quit R, then everything's is back to normal again. The 
usage of both CPUs go back down to between 5-10%.
Is there anyone out there using R in a university like this?
Does anyone have an idea what this might depend one or maybe a solution?
I can provide some more information if anyone wants, if you think you can 
help me.

Thanks in advance
/Sam


[[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] 3d bar plot

2005-01-17 Thread Marwan Khawaja
You can check these packages,
?scatterplot3d
?scatter3d

Best Marwan 

 
---
Marwan Khawaja http://staff.aub.edu.lb/~mk36/
---

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of R user
 Sent: Monday, January 17, 2005 12:37 PM
 To: r-help@stat.math.ethz.ch
 Subject: [R] 3d bar plot
 
 This graph - 
 http://www.math.hope.edu/~tanis/dallas/images/disth36.gif
 is an example I found at
 http://www.math.hope.edu/~tanis/dallas/disth1.html
 created by Maple.
 
 Does anybody know how to create something similar in R?
 
 I have a feeling it could be possible using scatterplot3d 
 (perhaps with type=h, the fourth example in 
 help('scatterplot3d')?), but I cannot figure it out.
 
 Thanks in advance,
 Jonne.
 
 __
 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] bold face labelling/expression

2005-01-17 Thread hagric
Dear colleagues,
I have a great problem in using expression for axes labels. I want the 
labels in bold face (i.e.: par(font.lab=2)). When typing

boxplot(y ~ groups, names =  , xlab = , ylab = , axes = F)
axis(side=1, at=c(1,2), xlab=c(expression(H[2]*O),others)),
I do not get a bold face labelling. Does anyone know, how I could proceed?
Thank you very much.
Best regards
H.
__
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-17 Thread Niels Steen Krogh
see ?par
look for par(new=T)
(if you want plot-overlay)
or just
?lines
(if you want several lines in one plot)
__
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] randomForest: too many element specified?

2005-01-17 Thread luk
When I run randonForest with a 169453x5 matrix, I got the following message. 

Error in matrix(0, n, n) : matrix: too many elements specified

Can you please advise me how to solve this problem?
 
Thanks,
 
Lu

Uwe Ligges [EMAIL PROTECTED] wrote:
Vera Hofer wrote:

 Dear colleagues,
 
 I have a great problem in using expression for axes labels. I want the 
 labels in bold face (i.e.: par(font.lab=2)). When typing
 
 boxplot(y ~ groups, names =  , xlab = , ylab = , axes = F)
 axis(side=1, at=c(1,2), xlab=c(expression(H[2]*O),others)),

1. If you don't mean labels instead of xlab in the axis() call, use 
xlab in the boxplot() call or in a call to title() (but then, you cannot 
use c(expression(), ...).

2. See ?plotmath and use, e.g., bold(H[2]*O) ...

Uwe Ligges


 I do not get a bold face labelling. Does anyone know, how I could proceed?
 Thank you very much.
 
 Best regards
 V.H.
 
 __
 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


-


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


[R] Question about time series

2005-01-17 Thread Dennis Fisher
I have data in the following format:
 DATE
[1] 01/13/2004
In order to find the difference between two data points, I presently 
use brute force to calculate the day of the year:

 strptime(DATE, format=%m/%d/%Y)$yday
[1] 12
Although this works, it may not be robust over different years.  I 
assume that R is sufficiently clever that a much simpler approach 
exists, e.g., can I calculate the number of days since some fixed time? 
 Unfortunately, the man pages and FAQ did not lead me to an obvious 
solution.

Any help appreciated.
Dennis
Dennis Fisher MD
P  (The P Less Than Company)
Phone: 1-866-PLessThan (1-866-753-7784)
Fax: 1-415-564-2220
www.PLessThan.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


RE: [R] randomForest: too many element specified?

2005-01-17 Thread Liaw, Andy
 From: luk
 
 When I run randonForest with a 169453x5 matrix, I got the 
 following message. 
 
 Error in matrix(0, n, n) : matrix: too many elements specified
 
 Can you please advise me how to solve this problem?
  
 Thanks,
  
 Lu

1.  When asking new questions, please don't reply to other posts.

2.  When asking questions like these, please do show the commands you used.

My guess is that you asked for the proximity matrix, or is running
unsupervised randomForest (by not providing a response vector).  This will
requires a couple of n by n matrices to be created (on top of other things),
n being 169453 in this case.  To store a 169453 x 169453 matrix in double
precision, you need 169453^2 * 8 bytes, or or nearly 214 GB of memory.  Even
if you have that kind of hardware, I doubt you'll be able to make much sense
out of the result.

Andy

 
 Uwe Ligges [EMAIL PROTECTED] wrote:
 Vera Hofer wrote:
 
  Dear colleagues,
  
  I have a great problem in using expression for axes 
 labels. I want the 
  labels in bold face (i.e.: par(font.lab=2)). When typing
  
  boxplot(y ~ groups, names =  , xlab = , ylab = , axes = F)
  axis(side=1, at=c(1,2), xlab=c(expression(H[2]*O),others)),
 
 1. If you don't mean labels instead of xlab in the axis() 
 call, use 
 xlab in the boxplot() call or in a call to title() (but then, 
 you cannot 
 use c(expression(), ...).
 
 2. See ?plotmath and use, e.g., bold(H[2]*O) ...
 
 Uwe Ligges
 
 
  I do not get a bold face labelling. Does anyone know, how I 
 could proceed?
  Thank you very much.
  
  Best regards
  V.H.
  
  __
  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
 
   
 
 -
 
 
   [[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
 


__
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] 3d bar plot

2005-01-17 Thread John Fox
Dear Marwan and Jonne,

I don't think that there's a scatter3d package, so perhaps Marwan is
referring to the scatter3d() function in the Rcmdr package. If so, that
function won't make the kind of 3D graph that Jonne wants -- though the rgl
package, on which scatter3d() is based, should be able to create the graph. 

I don't believe that the scatterplot3d() function in the scatterplot3d
package can make the plot either, but I may be wrong.

I hope this helps.

John


John Fox
Department of Sociology
McMaster University
Hamilton, Ontario
Canada L8S 4M4
905-525-9140x23604
http://socserv.mcmaster.ca/jfox 
 

 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of Marwan Khawaja
 Sent: Sunday, January 16, 2005 7:04 PM
 To: 'R user'; r-help@stat.math.ethz.ch
 Subject: RE: [R] 3d bar plot
 
 You can check these packages,
 ?scatterplot3d
 ?scatter3d
 
 Best Marwan 
 
  
 ---
 Marwan Khawaja http://staff.aub.edu.lb/~mk36/
 ---
 
  -Original Message-
  From: [EMAIL PROTECTED] 
  [mailto:[EMAIL PROTECTED] On Behalf Of R user
  Sent: Monday, January 17, 2005 12:37 PM
  To: r-help@stat.math.ethz.ch
  Subject: [R] 3d bar plot
  
  This graph -
  http://www.math.hope.edu/~tanis/dallas/images/disth36.gif
  is an example I found at
  http://www.math.hope.edu/~tanis/dallas/disth1.html
  created by Maple.
  
  Does anybody know how to create something similar in R?
  
  I have a feeling it could be possible using scatterplot3d (perhaps 
  with type=h, the fourth example in help('scatterplot3d')?), but I 
  cannot figure it out.
  
  Thanks in advance,
  Jonne.
  
  __
  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-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] find source code

2005-01-17 Thread r . ghezzo
I am using R 2.0.2 on a WinXP
I am trying to get the code of the Kruskal-Wallis test but
 kruskal.test
function (x, ...)
UseMethod(kruskal.test)
environment: namespace:stats

 ls(3)
  [1] acf  acf2AR   add.scope
..
[181] kruskal.test ks.test  ksmooth
...
[475] window- write.ftable xtabs

 class(kruskal.test)
[1] function

 getS3method(kruskal.test,function)
Error in getS3method(kruskal.test, function) :
S3 method kruskal.test.function not found

 getS3method(stats::kruskal.test,function)
Error in getS3method(stats::kruskal.test, function) :
no function 'stats::kruskal.test' could be found

I searched the archives and the answer was ' use getS3method ' . The help for
getS3method is getS3method(f,class,optional=FALSE) so I am lost
Can somebody tell me how to get the source listing of kruskal.test or of any
other hidden function?
Thanks
Heberto Ghezzo
Meakins-Christie Labs
Canada

__
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] find source code

2005-01-17 Thread Simon Wood
stats:::kruskal.test.default

On Mon, 17 Jan 2005 [EMAIL PROTECTED] wrote:

 I am using R 2.0.2 on a WinXP
 I am trying to get the code of the Kruskal-Wallis test but
  kruskal.test
 function (x, ...)
 UseMethod(kruskal.test)
 environment: namespace:stats
 
  ls(3)
   [1] acf  acf2AR   add.scope
 ..
 [181] kruskal.test ks.test  ksmooth
 ...
 [475] window- write.ftable xtabs
 
  class(kruskal.test)
 [1] function
 
  getS3method(kruskal.test,function)
 Error in getS3method(kruskal.test, function) :
 S3 method kruskal.test.function not found
 
  getS3method(stats::kruskal.test,function)
 Error in getS3method(stats::kruskal.test, function) :
 no function 'stats::kruskal.test' could be found
 
 I searched the archives and the answer was ' use getS3method ' . The help for
 getS3method is getS3method(f,class,optional=FALSE) so I am lost
 Can somebody tell me how to get the source listing of kruskal.test or of any
 other hidden function?
 Thanks
 Heberto Ghezzo
 Meakins-Christie Labs
 Canada
 
 __
 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] find source code

2005-01-17 Thread Liaw, Andy
 From: [EMAIL PROTECTED]
 
 I am using R 2.0.2 on a WinXP

Does that version of R exist?

 I am trying to get the code of the Kruskal-Wallis test but
  kruskal.test
 function (x, ...)
 UseMethod(kruskal.test)
 environment: namespace:stats
 
  ls(3)
   [1] acf  acf2AR   add.scope
 ..
 [181] kruskal.test ks.test  ksmooth
 ...
 [475] window- write.ftable xtabs
 
  class(kruskal.test)
 [1] function
 
  getS3method(kruskal.test,function)
 Error in getS3method(kruskal.test, function) :
 S3 method kruskal.test.function not found
 
  getS3method(stats::kruskal.test,function)
 Error in getS3method(stats::kruskal.test, function) :
 no function 'stats::kruskal.test' could be found
 
 I searched the archives and the answer was ' use getS3method 
 ' . The help for
 getS3method is getS3method(f,class,optional=FALSE) so I am lost
 Can somebody tell me how to get the source listing of 
 kruskal.test or of any
 other hidden function?

Before you use getS3method(), you need to know which S3 method you want to
get.  To see what S3 methods are available, use:

 methods(kruskal.test)
[1] kruskal.test.default* kruskal.test.formula*

Non-visible functions are asterisked

Andy

 Thanks
 Heberto Ghezzo
 Meakins-Christie Labs
 Canada
 
 __
 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] [basic ?] Merging result of by processing with a data frame

2005-01-17 Thread Jean-Louis Abitbol
Dear All,

I would like to merge a data frame such as:

 basetab
   subject dose  cmax
1 1031   50  21.8


with the result of a by processing such as:

 tmax-by(pkga,subject,f.tmax)
 tmax
subject: 1031
[1] 6
--

f.tmax being a function written by H. Nguyen (in applied statistics in
the pharmaceutical industry). pkga is a data frame with subject conc
time variates.

The aim is to have a single data frame with subject dose cmax tmax etc
(AUCs) ... so that I can do summary stats and plots by dose.


I have tried unlist without success.

Thanks for any help.

Kind regards, Jean-Louis

__
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] Question about time series

2005-01-17 Thread Christian Schulz
Hi
TODAY   - as.POSIXlt('2004-01-17')
LYTODAY  - as.POSIXlt('2003-01-17')
DAYS - TODAY-LYTODAY
DAYS
Time difference of 365 days
DAYS[[1]]
[1] 365
perhaps it helps,
Christian
Dennis Fisher wrote:
I have data in the following format:
 DATE
[1] 01/13/2004
In order to find the difference between two data points, I presently 
use brute force to calculate the day of the year:

 strptime(DATE, format=%m/%d/%Y)$yday
[1] 12
Although this works, it may not be robust over different years.  I 
assume that R is sufficiently clever that a much simpler approach 
exists, e.g., can I calculate the number of days since some fixed 
time?  Unfortunately, the man pages and FAQ did not lead me to an 
obvious solution.

Any help appreciated.
Dennis
Dennis Fisher MD
P  (The P Less Than Company)
Phone: 1-866-PLessThan (1-866-753-7784)
Fax: 1-415-564-2220
www.PLessThan.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

__
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] find source code

2005-01-17 Thread Uwe Ligges
Simon Wood wrote:
stats:::kruskal.test.default

and how to get there:
methods(kruskal.test) # note, you probably want the default method!
getS3method(kruskal.test, default)
Uwe

On Mon, 17 Jan 2005 [EMAIL PROTECTED] wrote:

I am using R 2.0.2 on a WinXP
I am trying to get the code of the Kruskal-Wallis test but
kruskal.test
function (x, ...)
UseMethod(kruskal.test)
environment: namespace:stats
ls(3)
 [1] acf  acf2AR   add.scope
..
[181] kruskal.test ks.test  ksmooth
...
[475] window- write.ftable xtabs

class(kruskal.test)
[1] function

getS3method(kruskal.test,function)
Error in getS3method(kruskal.test, function) :
   S3 method kruskal.test.function not found

getS3method(stats::kruskal.test,function)
Error in getS3method(stats::kruskal.test, function) :
   no function 'stats::kruskal.test' could be found
I searched the archives and the answer was ' use getS3method ' . The help for
getS3method is getS3method(f,class,optional=FALSE) so I am lost
Can somebody tell me how to get the source listing of kruskal.test or of any
other hidden function?
Thanks
Heberto Ghezzo
Meakins-Christie Labs
Canada
__
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-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] 3d bar plot

2005-01-17 Thread Uwe Ligges
John Fox wrote:
Dear Marwan and Jonne,
I don't think that there's a scatter3d package, so perhaps Marwan is
referring to the scatter3d() function in the Rcmdr package. If so, that
function won't make the kind of 3D graph that Jonne wants -- though the rgl
package, on which scatter3d() is based, should be able to create the graph. 

I don't believe that the scatterplot3d() function in the scatterplot3d
package can make the plot either, but I may be wrong.
John, you are right. scatterplot3d is not designed to do stuff like 
that. You can do some workarounds, but it will look rather ugly.

Uwe

I hope this helps.
John

John Fox
Department of Sociology
McMaster University
Hamilton, Ontario
Canada L8S 4M4
905-525-9140x23604
http://socserv.mcmaster.ca/jfox 
 


-Original Message-
From: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] On Behalf Of Marwan Khawaja
Sent: Sunday, January 16, 2005 7:04 PM
To: 'R user'; r-help@stat.math.ethz.ch
Subject: RE: [R] 3d bar plot

You can check these packages,
?scatterplot3d
?scatter3d
Best Marwan 

---
Marwan Khawaja http://staff.aub.edu.lb/~mk36/
---

-Original Message-
From: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] On Behalf Of R user
Sent: Monday, January 17, 2005 12:37 PM
To: r-help@stat.math.ethz.ch
Subject: [R] 3d bar plot

This graph -
http://www.math.hope.edu/~tanis/dallas/images/disth36.gif
is an example I found at
http://www.math.hope.edu/~tanis/dallas/disth1.html
created by Maple.
Does anybody know how to create something similar in R?
I have a feeling it could be possible using scatterplot3d (perhaps 
with type=h, the fourth example in help('scatterplot3d')?), but I 
cannot figure it out.

Thanks in advance,
Jonne.
__
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-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] kmeans with weighted variables

2005-01-17 Thread HYRIEN Matthieu
Hello,

 

I'm having troubles finding how to weight some variables for a k-means
clustering.

 

Can you please let me know what arguments I should had to:

 

z - kmeans(A, 3, 10)

 

if I want to put different weights for 3 of the 6 variables I'm using to
classify these individuals.

 

Many thanks

 

Regards

 

Matthieu HYRIEN

 

GEOSYS S.A.

Office: 0033 (0)5 62 47 80 92

Mob: 0044 (0)7791 789 467

www.geosys.com

 

 


[[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] Setting the width and height of a Sweave figure

2005-01-17 Thread Bjørn-Helge Mevik
I haven't found any other solution than using

fig=TRUE,height=7,width=14
theCode()
@

(but of course that doesn't have any effect when theCode() is used
interactively).

-- 
Bjørn-Helge Mevik

__
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] Omitting constant in ols() from Design

2005-01-17 Thread Tobias Muhlhofer
Hi!
I need to run ols regressions with Huber-White sandwich estimators and 
the correponding standard errors, without an intercept. What I'm trying 
to do is create an ols object and then use the robcov() function, on the 
order of:

f - ols(depvar ~ ind1 + ind2, x=TRUE)
robcov(f)
However, when I go
f - ols(depvar ~ ind1 + ind2 -1, x=TRUE)
I get the following error:
Error in ols(nareit ~ SnP500 + d3yrtr - 1) :
length of dimnames [2] not equal to array extent
same with +0 instead of -1.
Is there a different way to create an ols object without a constant? I 
can't use lm(), because robcov() needs an object from the Design() series.

Or is there a different way to go about this?
Tobias Muhlhofer
__
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] find source code

2005-01-17 Thread TEMPL Matthias
But how can I see the *documented* source code in Windows? I think i.e.
in the /flexmix/library/man/all.rda file is the documented(?) code for
all functions of Package flexmix, but the standard Windows XP cannot
open .rda files correct.

Is there a way to read the documented source code of a function under
Windows and R2.0.1?

Thanks in advance,
Matthias


 Betreff: Re: [R] find source code
 
 
 stats:::kruskal.test.default
 
 On Mon, 17 Jan 2005 [EMAIL PROTECTED] wrote:
 
  I am using R 2.0.2 on a WinXP
  I am trying to get the code of the Kruskal-Wallis test but
   kruskal.test
  function (x, ...)
  UseMethod(kruskal.test)
  environment: namespace:stats
  
   ls(3)
[1] acf  acf2AR   add.scope
  ..
  [181] kruskal.test ks.test  ksmooth
  ...
  [475] window- write.ftable xtabs
  
   class(kruskal.test)
  [1] function
  
   getS3method(kruskal.test,function)
  Error in getS3method(kruskal.test, function) :
  S3 method kruskal.test.function not found
  
   getS3method(stats::kruskal.test,function)
  Error in getS3method(stats::kruskal.test, function) :
  no function 'stats::kruskal.test' could be found
  
  I searched the archives and the answer was ' use 
 getS3method ' . The 
  help for getS3method is getS3method(f,class,optional=FALSE) so I am 
  lost Can somebody tell me how to get the source listing of 
  kruskal.test or of any other hidden function? Thanks
  Heberto Ghezzo
  Meakins-Christie Labs
  Canada
  
  __
  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-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] find source code

2005-01-17 Thread Liaw, Andy
 From: TEMPL Matthias
 
 But how can I see the *documented* source code in Windows? I 
 think i.e.
 in the /flexmix/library/man/all.rda file is the documented(?) code for
 all functions of Package flexmix, but the standard Windows XP cannot
 open .rda files correct.
 
 Is there a way to read the documented source code of a function under
 Windows and R2.0.1?

Do you mean `commented' rather than `documented' (i.e., having a help page)?
If so, I believe the only guaranteed way of doing that is by getting the
package _source_ (i.e., the .tar.gz file) from CRAN and read the file in the
R/ subdirectory after unpacking.  This has nothing to do with
hardware/software platform.

.rda files are really only readable by R, regardless of platform, and R on
Windows doesn't behave differently than on other OS in this respect.

Andy

 
 Thanks in advance,
 Matthias
 
 
  Betreff: Re: [R] find source code
  
  
  stats:::kruskal.test.default
  
  On Mon, 17 Jan 2005 [EMAIL PROTECTED] wrote:
  
   I am using R 2.0.2 on a WinXP
   I am trying to get the code of the Kruskal-Wallis test but
kruskal.test
   function (x, ...)
   UseMethod(kruskal.test)
   environment: namespace:stats
   
ls(3)
 [1] acf  acf2AR   add.scope
   ..
   [181] kruskal.test ks.test  ksmooth
   ...
   [475] window- write.ftable xtabs
   
class(kruskal.test)
   [1] function
   
getS3method(kruskal.test,function)
   Error in getS3method(kruskal.test, function) :
   S3 method kruskal.test.function not found
   
getS3method(stats::kruskal.test,function)
   Error in getS3method(stats::kruskal.test, function) :
   no function 'stats::kruskal.test' could be found
   
   I searched the archives and the answer was ' use 
  getS3method ' . The 
   help for getS3method is 
 getS3method(f,class,optional=FALSE) so I am 
   lost Can somebody tell me how to get the source listing of 
   kruskal.test or of any other hidden function? Thanks
   Heberto Ghezzo
   Meakins-Christie Labs
   Canada
   
   __
   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-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] find source code

2005-01-17 Thread Peter Dalgaard
TEMPL Matthias [EMAIL PROTECTED] writes:

 But how can I see the *documented* source code in Windows? I think i.e.
 in the /flexmix/library/man/all.rda file is the documented(?) code for
 all functions of Package flexmix, but the standard Windows XP cannot
 open .rda files correct.

No that's not it. The .rda files are like R workspaces.
 
 Is there a way to read the documented source code of a function under
 Windows and R2.0.1?

Yes. Fetch the source code for the package or R itself, and read the
relevant source files. These are available from CRAN.

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


[R] How do I format something as 0.000?

2005-01-17 Thread Christian Hennig
Hi,

I would like to use the format function to get numbers all with three 
digits to the right of the decimal point, even in cases where there is no
significant digit left. For example, I would like to get
c(0.3456789,0.053) as 0.346 0.000.
It seems that it is not possible to force format to print a 0.000, i.e.
without any significant decimal places.
Is it possible to do this somehow in R?

Thanks,
Christian


***
Christian Hennig
Fachbereich Mathematik-SPST/ZMS, Universitaet Hamburg
[EMAIL PROTECTED], http://www.math.uni-hamburg.de/home/hennig/
###
ich empfehle www.boag-online.de

__
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] Omitting constant in ols() from Design

2005-01-17 Thread Achim Zeileis
On Mon, 17 Jan 2005 14:57:33 + Tobias Muhlhofer wrote:

 Hi!
 
 I need to run ols regressions with Huber-White sandwich estimators and
 the correponding standard errors, without an intercept. What I'm
 trying to do is create an ols object and then use the robcov()
 function, on the order of:
 
 f - ols(depvar ~ ind1 + ind2, x=TRUE)
 robcov(f)
 
 However, when I go
 
 f - ols(depvar ~ ind1 + ind2 -1, x=TRUE)
 
 I get the following error:
 
 Error in ols(nareit ~ SnP500 + d3yrtr - 1) :
  length of dimnames [2] not equal to array extent
 
 same with +0 instead of -1.
 
 Is there a different way to create an ols object without a constant? I
 can't use lm(), because robcov() needs an object from the Design()
 series.
 
 Or is there a different way to go about this?

I am not sure if the problem can also be avoided or worked around in
Design, but the functions hccm() from car or vcovHC() from sandwich can
also compute the Huber-White (and other) HC covariance matrix estimates
for fitted lm objects.
For computing the corresponding t-tests or z-tests, you can use the
function coeftest() in lmtest. See the corresponding man page for
examples.

Best,
Z

 Tobias Muhlhofer
 
 __
 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] How do I format something as 0.000?

2005-01-17 Thread Achim Zeileis
On Mon, 17 Jan 2005 16:49:35 +0100 (MET) Christian Hennig wrote:

 Hi,
 
 I would like to use the format function to get numbers all with three 
 digits to the right of the decimal point, even in cases where there is
 no significant digit left. For example, I would like to get
 c(0.3456789,0.053) as 0.346 0.000.
 It seems that it is not possible to force format to print a 0.000,
 i.e. without any significant decimal places.
 Is it possible to do this somehow in R?

You can round() before:

R x - c(0.3456789,0.053)
R round(x, digits = 3)
[1] 0.346 0.000
R format(round(x, digits = 3))
[1] 0.346 0.000

hth,
Z

 Thanks,
 Christian
 
 
 *
 ** Christian Hennig
 Fachbereich Mathematik-SPST/ZMS, Universitaet Hamburg
 [EMAIL PROTECTED],
 http://www.math.uni-hamburg.de/home/hennig/
 #
 ###
 ich empfehle www.boag-online.de
 
 __
 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] Omitting constant in ols() from Design

2005-01-17 Thread Frank E Harrell Jr
Tobias Muhlhofer wrote:
Hi!
I need to run ols regressions with Huber-White sandwich estimators and 
the correponding standard errors, without an intercept. What I'm trying 
to do is create an ols object and then use the robcov() function, on the 
order of:

f - ols(depvar ~ ind1 + ind2, x=TRUE)
robcov(f)
However, when I go
f - ols(depvar ~ ind1 + ind2 -1, x=TRUE)
I get the following error:
Error in ols(nareit ~ SnP500 + d3yrtr - 1) :
length of dimnames [2] not equal to array extent
same with +0 instead of -1.
Is there a different way to create an ols object without a constant? I 
can't use lm(), because robcov() needs an object from the Design() series.

Or is there a different way to go about this?
Tobias Muhlhofer
ols does not support this.  Sorry.
--
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


[R] merge data frames taking mean/mode of multiple macthes

2005-01-17 Thread avneet singh
Hello :)

I have two data frames, one has properties taken on a
piece by piece basis and the other has performance on
a lot by lot basis. I wish to combine these two data
frames but the problem is that each lot has multiple
pieces and hence i need to take a mean of the
properties of multiple pieces and match it to the row
having data about the lot.

I was wondering if there is a simple commmand, an
extension of merge, or an option of merge i do not
know which could easily do this work.

Thank you  :)

=
I believe in equality for everyone, except reporters and photographers.
~Mahatma Gandhi

__
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-17 Thread Murray Eisenberg
The problem with RWinEdt can be resolved by NOT using User Profiles in 
WinEdt:

I did a clean re-install of WinEdt 5.4, build 20050114.  Then, executing 
library(RWinEdt) in the RGui did start up a properly configured 
R-WinEdt session of WinEdt.  No error messages; the expected R buttons 
were now on the R-WinEdt menu bar.

However, it would desirable if RWinEdt were revised so as to be 
compatible with WinEdt User Profiles.  The reason is that WinEdt 
encourages use of User Profiles so that, when one upgrades WinEdt 
itself, the settings are not lost.  (And, in general, the idea of 
separating a program such as WinEdt from user settings for it is a good 
one.)

Uwe Ligges wrote:
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
--
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


Re: [R] find source code

2005-01-17 Thread TEMPL Matthias

 -Ursprüngliche Nachricht-
 Von: Liaw, Andy [mailto:[EMAIL PROTECTED] 
 Gesendet: Montag, 17. Jänner 2005 16:33
 An: TEMPL Matthias; r-help@stat.math.ethz.ch
 Betreff: RE: [R] find source code
 
 
  From: TEMPL Matthias
  
  But how can I see the *documented* source code in Windows? I
  think i.e.
  in the /flexmix/library/man/all.rda file is the 
 documented(?) code for
  all functions of Package flexmix, but the standard Windows XP cannot
  open .rda files correct.
  
  Is there a way to read the documented source code of a 
 function under 
  Windows and R2.0.1?
 
 Do you mean `commented' rather than `documented' (i.e., 
 having a help page)? If so, I believe the only guaranteed way 
 of doing that is by getting the package _source_ (i.e., the 
 .tar.gz file) from CRAN and read the file in the R/ 
 subdirectory after unpacking.  This has nothing to do with 
 hardware/software platform.
 

Sorry for my poor english and thank you for your quick replies! 
I have meant the `commented' source code.
Now I know that the commented source code is findable in the (unpacked) 
..tar.gz file and not in the .zip file.

Thank you very much,
Matthias


 .rda files are really only readable by R, regardless of 
 platform, and R on Windows doesn't behave differently than on 
 other OS in this respect.
 
 Andy
 
  
  Thanks in advance,
  Matthias
  
  
   Betreff: Re: [R] find source code
   
   
   stats:::kruskal.test.default
   
   On Mon, 17 Jan 2005 [EMAIL PROTECTED] wrote:
   
I am using R 2.0.2 on a WinXP
I am trying to get the code of the Kruskal-Wallis test but
 kruskal.test
function (x, ...)
UseMethod(kruskal.test)
environment: namespace:stats

 ls(3)
  [1] acf  acf2AR   add.scope
..
[181] kruskal.test ks.test  ksmooth
...
[475] window- write.ftable xtabs

 class(kruskal.test)
[1] function

 getS3method(kruskal.test,function)
Error in getS3method(kruskal.test, function) :
S3 method kruskal.test.function not found

 getS3method(stats::kruskal.test,function)
Error in getS3method(stats::kruskal.test, function) :
no function 'stats::kruskal.test' could be found

I searched the archives and the answer was ' use
   getS3method ' . The
help for getS3method is
  getS3method(f,class,optional=FALSE) so I am
lost Can somebody tell me how to get the source listing of
kruskal.test or of any other hidden function? Thanks
Heberto Ghezzo
Meakins-Christie Labs
Canada

__
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-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
  
  
 
 
 --
 
 Notice:  This e-mail message, together with any attachments, 
 contains information of Merck  Co., Inc. (One Merck Drive, 
 Whitehouse Station, New Jersey, USA 08889), and/or its 
 affiliates (which may be known outside the United States as 
 Merck Frosst, Merck Sharp  Dohme or MSD and in Japan, as 
 Banyu) that may be confidential, proprietary copyrighted 
 and/or legally privileged. It is intended solely for the use 
 of the individual or entity named on this message.  If you 
 are not the intended recipient, and have received this 
 message in error, please notify us immediately by reply 
 e-mail and then delete it from your system.
 --
 


__
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] merge data frames taking mean/mode of multiple macthes

2005-01-17 Thread Christoph Buser
Dear Avneet

the function aggregate (see also ?aggregate) could be useful for
your problem. See the short example I've written below.

dat1 - data.frame(lot = factor(1:10),y1 = rnorm(10))
str(dat1)
dat2 - data.frame(nr = 1:100, lot = factor(rep(1:10, each = 10)),y2 = 
rnorm(100))
str(dat2)

dat2.agr - aggregate(dat2$y, by = list(lot = dat2$lot), FUN = mean)
names(dat2.agr)[2] - y2

dat.mer - merge(dat1, dat2.agr)
str(dat.mer)

Be careful about merging dataframes. There should always be a
control that the right cases are merged together.

Regards,

Christoph Buser

-- 
Christoph Buser [EMAIL PROTECTED]
Seminar fuer Statistik, LEO C11
ETH (Federal Inst. Technology)  8092 Zurich  SWITZERLAND
phone: x-41-1-632-5414  fax: 632-1228
http://stat.ethz.ch/~buser/


avneet singh writes:
  Hello :)
  
  I have two data frames, one has properties taken on a
  piece by piece basis and the other has performance on
  a lot by lot basis. I wish to combine these two data
  frames but the problem is that each lot has multiple
  pieces and hence i need to take a mean of the
  properties of multiple pieces and match it to the row
  having data about the lot.
  
  I was wondering if there is a simple commmand, an
  extension of merge, or an option of merge i do not
  know which could easily do this work.
  
  Thank you  :)
  
  =
  I believe in equality for everyone, except reporters and photographers.
  ~Mahatma Gandhi
  
  __
  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

-- 
Christoph Buser [EMAIL PROTECTED]
Seminar fuer Statistik, LEO C11
ETH (Federal Inst. Technology)  8092 Zurich  SWITZERLAND
phone: x-41-1-632-5414  fax: 632-1228
http://stat.ethz.ch/~buser/

__
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] 3d bar plot

2005-01-17 Thread Duncan Murdoch
On Mon, 17 Jan 2005 08:49:06 -0500, John Fox [EMAIL PROTECTED]
wrote :

Dear Marwan and Jonne,

I don't think that there's a scatter3d package, so perhaps Marwan is
referring to the scatter3d() function in the Rcmdr package. If so, that
function won't make the kind of 3D graph that Jonne wants -- though the rgl
package, on which scatter3d() is based, should be able to create the graph. 

I don't believe that the scatterplot3d() function in the scatterplot3d
package can make the plot either, but I may be wrong.

I had a function in my (Windows-only) djmrgl package to do plots like
that; one of the things on my to-do list is to port it to rgl.  This
may happen in about a month.

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] debian /etc/apt/sources.list for CRAN?

2005-01-17 Thread Michael Friendly
When I set up my debian linux (unstable) system, the only R debian 
packages were on CRAN, so I
followed directions and added the last line to my /etc/apt/sources.list

euclid: # m /etc/apt/sources.list
deb http://debian.yorku.ca/debian/ unstable main non-free contrib
deb http://debian.yorku.ca/debian/non-US unstable/non-US main contrib 
non-free
deb http://hexamon.ccs.yorku.ca/ unixteam-debs/
deb http://cran.r-project.org/bin/linux/debian woody main

But now, when I try to update the local package cache I get errors (below).
Should I just delete the cran.r-project.org line
above, or are there debian R packages elsewhere on CRAN that I should 
include instead?

# apt-get update
Hit http://debian.yorku.ca unstable/main Packages
Hit http://debian.yorku.ca unstable/main Release
Hit http://debian.yorku.ca unstable/non-free Packages
Hit http://debian.yorku.ca unstable/non-free Release
Hit http://debian.yorku.ca unstable/contrib Packages
Hit http://debian.yorku.ca unstable/contrib Release
Hit http://debian.yorku.ca unstable/non-US/main Packages
Hit http://debian.yorku.ca unstable/non-US/main Release
Hit http://debian.yorku.ca unstable/non-US/contrib Packages
Hit http://debian.yorku.ca unstable/non-US/contrib Release
Hit http://debian.yorku.ca unstable/non-US/non-free Packages
Hit http://debian.yorku.ca unstable/non-US/non-free Release
Hit http://hexamon.ccs.yorku.ca unixteam-debs/ Packages
Ign http://hexamon.ccs.yorku.ca unixteam-debs/ Release
Err http://cran.r-project.org woody/main Packages
 404 Not Found
Ign http://cran.r-project.org woody/main Release
Failed to fetch 
http://cran.r-project.org/bin/linux/debian/dists/woody/main/binary-i386/Packages.gz  
404 Not Found
Reading Package Lists... Done
E: Some index files failed to download, they have been ignored, or old 
ones used instead.

--
Michael Friendly Email: [EMAIL PROTECTED] 
Professor, Psychology Dept.
York University  Voice: 416 736-5115 x66249 Fax: 416 736-5814
4700 Keele Streethttp://www.math.yorku.ca/SCS/friendly.html
Toronto, ONT  M3J 1P3 CANADA

__
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] Skewness test

2005-01-17 Thread Christian Hennig
Hi,

is there a test for the H0 skewness=0 (or with skewness as test
statistic and normality as H0) implemented in R?

Thank you,
Christian


***
Christian Hennig
Fachbereich Mathematik-SPST/ZMS, Universitaet Hamburg
[EMAIL PROTECTED], http://www.math.uni-hamburg.de/home/hennig/
###
ich empfehle www.boag-online.de

__
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] find source code

2005-01-17 Thread r . ghezzo
Thanks to all who answered my query, I forgot completely to call methods() first
to check the true whole name of the function.
Heberto Ghezzo

Quoting Uwe Ligges [EMAIL PROTECTED]:

 Simon Wood wrote:

  stats:::kruskal.test.default


 and how to get there:

 methods(kruskal.test) # note, you probably want the default method!
 getS3method(kruskal.test, default)


 Uwe


  On Mon, 17 Jan 2005 [EMAIL PROTECTED] wrote:
 
 
 I am using R 2.0.2 on a WinXP
 I am trying to get the code of the Kruskal-Wallis test but
 
 kruskal.test
 
 function (x, ...)
 UseMethod(kruskal.test)
 environment: namespace:stats
 
 ls(3)
 
   [1] acf  acf2AR   add.scope
 ..
 [181] kruskal.test ks.test  ksmooth
 ...
 [475] window- write.ftable xtabs
 
 
 class(kruskal.test)
 
 [1] function
 
 
 getS3method(kruskal.test,function)
 
 Error in getS3method(kruskal.test, function) :
 S3 method kruskal.test.function not found
 
 
 getS3method(stats::kruskal.test,function)
 
 Error in getS3method(stats::kruskal.test, function) :
 no function 'stats::kruskal.test' could be found
 
 I searched the archives and the answer was ' use getS3method ' . The help
 for
 getS3method is getS3method(f,class,optional=FALSE) so I am lost
 Can somebody tell me how to get the source listing of kruskal.test or of
 any
 other hidden function?
 Thanks
 Heberto Ghezzo
 Meakins-Christie Labs
 Canada
 
 __
 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-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] C-c C-c and tcltk cause R to get a segmentation fault

2005-01-17 Thread Jean Eid

when tcltk is called and a C-c C-c is issued a message of Illegal
instruction is issued and the R process is killed.  To reproduce please
do the following

require(tcltk)
C-c C-c

It will say Illegal instruction
I use a debian 2.4 kernel with R 2.0.1 tcltck version 2.0.1.
I use tcltk to have gui for setwd, any other methods to graphically do
this is also appreciated.

Thanks so much for any solutions.


Jean

__
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] debian /etc/apt/sources.list for CRAN?

2005-01-17 Thread Dirk Eddelbuettel
On Mon, Jan 17, 2005 at 01:39:23PM -0500, Michael Friendly wrote:
 Should I just delete the cran.r-project.org line
 above, 

I think so.  Plus, if you already point to Debian unstable, CRAN has nothing
you wouldn't have otherwise.

 or are there debian R packages elsewhere on CRAN that I should 
 include instead?

Not that I know of. 

In the past, CRAN had current Debian packages of R itself for Debian
flavours other than unstable which typically has the most current R version
right at release time. However, migration to testing can take time so the we
sometime kept the same . And for stable we used to have volunteer-donated
rebuilds of the current R. This has gotten progressively more difficult as
Debian stable got older and older, and process of creating the R packages
started to take advantage of facilities to available to the versions of the
tools in stable.

We have talked at times about providing more CRAN packages as Debian
packages, and possibly via CRAN itself rather than full Debian uploads. But
I have not had time to work on that for a while, and that is unfortunately
rather unlikely to change soon.  Others have expressed an interest in
helping as well but haven't gotten very far, unfortunately.

Fellow Debian maintainer Matt Hope, has started a project on Debian's alioth
host (that is open to non-Debianers who want to contribute) to coordinate
debianisation of BioConductor. As this would use the same infrastructures,
it could get used for CRAN too. But this project is also slow in progressing
-- we're all overworked volunteers in this.  

Right now I'd say this is waiting for someone with a real itch to scratch.

Regards,  Dirk

-- 
Better to have an approximate answer to the right question than a precise 
answer to the wrong question.  --  John Tukey as quoted by John Chambers

__
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] Skewness test

2005-01-17 Thread Dirk Eddelbuettel
On Mon, Jan 17, 2005 at 07:59:32PM +0100, Christian Hennig wrote:
 Hi,
 
 is there a test for the H0 skewness=0 (or with skewness as test
 statistic and normality as H0) implemented in R?

Not that I know of, but tseries has the standard Jarque-Bera test that
combines 3rd and 4th moment tests into a chisq(2) as on omnibus test for
normality.  Cutting and pasting from the code in tseries/R/test.R, one could
probably take that apart and just use 

m1 - sum(x)/n
m2 - sum((x-m1)^2)/n
m3 - sum((x-m1)^3)/n
m4 - sum((x-m1)^4)/n
b1 - (m3/m2^(3/2))^2

STATISTICS -  n * 1/6 * b1

as a chisq(1).  But I have no idea what the power of that test would be.  

Hth, Dirk

-- 
Better to have an approximate answer to the right question than a precise 
answer to the wrong question.  --  John Tukey as quoted by John Chambers

__
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] bwplot: how not to draw outliers

2005-01-17 Thread Sundar Dorai-Raj

RenE J.V. Bertin wrote:
Hello, and (somewhat belated) best wishes for 2005.
Can one order not to draw outliers in bwplot, or at least exclude them from the 
vertical axis scaling? If so, how (or what doc do I need to consult)?
The options that have this effect in boxplot() do not appear to have any effect 
with bwplot (although outline=FALSE in boxplot does *not* change the scaling).
Thanks,
RenE Bertin

RenE,
There may be other solutions but you can do this using the prepanel 
option to set the ylim:

library(lattice)
set.seed(1)
z - data.frame(x = rt(100, 1), g = rep(letters[1:4], each = 25))
bwplot(x ~ g, z,
   prepanel = function(x, y) {
 bp - boxplot(split(y, x), plot = FALSE)
 ylim - range(bp$stats)
 list(ylim = ylim)
   })
If you actually want to exclude the points (rather than just prevent 
outliers from affecting the scale), you will have to modify the 
panel.bwplot function in addition to using the above.

--sundar
__
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] subsetting like in SAS

2005-01-17 Thread Denis Chabot
I want to thank Petr Pikal, Robert Balshaw and Na Li for suggesting the 
use of unique or !duplicated on a subset of my data where unwanted 
variables have been removed. This worked perfectly.

Denis Chabot
On 13 Jan 2005 at 11:52, Denis Chabot wrote:
Hi,
Being in the process of translating some of my SAS programs to R, I
encountered one difficulty. I have a solution, but it is not elegant
(and not pleasant to implement).
I have a large dataset with many variables needed to identify the
origin of a sample, many to describe sample characteristics, others to
describe site characteristics.
I want only a (shorter) list of sites and their characteristics.
If origin, ship_cat, ship_nb, trip and set are needed to
identify a site, in SAS you'd sort on those variables, then read the
data with:
data sites;
 set alldata;
 by origin ship_cat ship_nb trip set;
 if first.set;
 keep list-of-variables-detailing-sites;
run;
In R I did this with the Lag function of Hmisc, and the original data
set also needs to be sorted first:
oL - Lag(origin)
scL - Lag(ship_cat)
snL - Lag(ship_nb)
tL - Lag(trip)
sL - Lag(set)
same - origin==oL  ship_cat==scL  ship_nb==snL  trip==tL  set==sL
sites - subset(alldata, !same,
select=c(list-of-variables-detailing-sites)
Could I do better than this?
__
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] problem installing RSPython

2005-01-17 Thread Robert Sams
Hi,

I'm trying to install RSPython v0.5-4 on a debian machine (woody,
testing) but am having the following problem.

$R CMD INSTALL -c --library=/usr/lib/R/library RSPython_0.5-4.tar.gz 2err

But then...
$python
 import RS
Error in .PythonInit() : Error in Python call: values
Error in library(RSPython) : .First.lib failed for 'RSPython'
Traceback (most recent call last):
  File stdin, line 1, in ?
  File /usr/lib/R/library/RSPython/Python/RS.py, line 69, in ?
library(RSPython)
  File /usr/lib/R/library/RSPython/Python/RS.py, line 58, in library
return(call(library, name));
  File /usr/lib/R/library/RSPython/Python/RS.py, line 21, in call
return RSInternal.call(name, args, other, convert, ref)
RuntimeError: error in calling R: Error in library(RSPython) : .First.lib 
failed for 'RSPython'

Hmm... But the installation is ok, except for these warnings:
$more err
PythonCall.c: In function `RPy_get':
PythonCall.c:305: warning: passing arg 1 of `PyImport_ImportModule' discards 
qualifiers from pointer target type
RCall.c: In function `RPy_callPython':
RCall.c:62: warning: passing arg 1 of `PyType_GenericNew' from incompatible 
pointer type


I'm running R v2.0.1, Python v2.3.4 and have the r-base-dev and
python2.3-dev packages installed. Relevant environment variable settings:
PYTHONPATH=/usr/lib/python2.3:/usr/lib/python2.3/site-packages
R_HOME=/usr/lib/R
PYTHONPATH=${PYTHONPATH}:${R_HOME}/library/RSPython/Python
PYTHONPATH=${PYTHONPATH}:${R_HOME}/library/RSPython/libs
LD_LIBRARY_PATH=${R_HOME}/lib

Any suggestions? I'm probably overlooking something obvious. Thanks.

Robert


Robert Sams

SANCTUM FI LLP
Authorised and Regulated by the FSA. 

Sending encrypted mail:

See http://pgp.mit.edu (search string 'sanctumfi') for updates.
-BEGIN PGP PUBLIC KEY BLOCK-
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

mQGiBEHVOaIRBAC3kUplVB1o00GQXU9TkKmMWz/LiknbhLgDPBZ+1nw1ffb2FpXW
mYet2yja8YIG3H2LnVla1WGVyfAyZ+QRmnUgm2hOnP7LNZIoHctnGqLmtQvOXvHz
xoDonFAl/ztBFE9aNPbiL4nlgdz9GS6LN6hbw9GTdYGip71QhaeVIRR3HwCgySSl
rUtSV8C7nbHR9C+zwku3EpMD/0yoq1R4lQgJGNbyjzzCRWRblK5cKLh1XUYG3JSc
ltLhoCZMvR+359FUSz+jEbbJaLRpquX48Wjv+7WW5KNVm2nPHSZrZ6tr+nm/ov1Y
DQxbIvBHxLXxltDWJlL/gg3bPaSIRlj/KVw0fB0NU1b25eGFRTtlHEvkAROj92sv
MiaSA/9jjEi2H0+yWujcBxJ6syUjWLlgRxvm85sJBihyan4ufAMFRria+QKx7ZMf
A7MNJ+r7ULdqCPsPdZP3kC7GNfLXBzizy3d2HSB/0oB7AjIoXrYyQvXQjFNQQX+u
XjeRGhALxou3H1NEPiCiHJiiaPU6Uh+KYhBCDOYZpc82FgKwWLQzUm9iZXJ0IFNh
bXMgKFNhbmN0dW0gRkkgTExQKSA8cm9iZXJ0QHNhbmN0dW1maS5jb20+iF0EExEC
AB0FAkHVOaIFCQHhM4AFCwcKAwQDFQMCAxYCAQIXgAAKCRB4Q4+orHX8Yk0hAJ9+
odzCRiih6wZz4NOOSVboJP+lngCeNvFGVxVQW35/qpTaF6wsym9jehi5AQ0EQdU5
oxAEALZEnBUQqKiF/gUqK7zyLJarsVxGsmuj0pkV5gFwCbChA4RA7QgHjknJT3Qd
jLUJOa+rW49WtbDCOBv+VOVp//gLROByZpizW4BYaOw01kI9emMuoc6el6nYXarJ
6aZcA84IFBifdi2a8lB3ofhQuWc/YmxLjcOKbkaIC9lUYHrzAAMGA/0RRhkXCHCL
zRSQj+7nSBE4MTeMJycdytl1wnpWkRUa8MoUYBF6/3oiyCnO9bHbOAkQrULSWRLA
YsUJv0c1b6Dht5LVChGikJqKgCzWVEVUI7ob0F2LctvDxhZLlCctHapFGZn9+6pi
rZW+2XkBmbqhJ8ybKsRAIJNy7OV3sIHoVYhMBBgRAgAMBQJB1TmjBQkB4TOAAAoJ
EHhDj6isdfxizmIAn3I/mZyfAuBNZl0lG+9XpAhR80ThAKDAJEnXrH8dX30rRwDz
1mgpwRYCiw==
=59j7
-END PGP PUBLIC KEY BLOCK-

__
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] bwplot: how not to draw outliers

2005-01-17 Thread Deepayan Sarkar
On Monday 17 January 2005 14:51, Sundar Dorai-Raj wrote:
 RenE J.V. Bertin wrote:
  Hello, and (somewhat belated) best wishes for 2005.
 
  Can one order not to draw outliers in bwplot, or at least exclude
  them from the vertical axis scaling? If so, how (or what doc do I
  need to consult)? The options that have this effect in boxplot() do
  not appear to have any effect with bwplot (although outline=FALSE
  in boxplot does *not* change the scaling).
 
  Thanks,
  RenE Bertin

 RenE,

 There may be other solutions but you can do this using the prepanel
 option to set the ylim:

 library(lattice)
 set.seed(1)
 z - data.frame(x = rt(100, 1), g = rep(letters[1:4], each = 25))
 bwplot(x ~ g, z,
 prepanel = function(x, y) {
   bp - boxplot(split(y, x), plot = FALSE)
   ylim - range(bp$stats)
   list(ylim = ylim)
 })

 If you actually want to exclude the points (rather than just prevent
 outliers from affecting the scale), you will have to modify the
 panel.bwplot function in addition to using the above.

Right. panel.bwplot calls 

   stats - boxplot.stats(y[x == xval], coef = coef)

I guess it should have a 'do.out' argument as well. A workaround 
(without changing the panel function) might be to use something like

bwplot(voice.part ~ height, data = singer, 
   par.settings = list(plot.symbol = list(col = transparent)))

(neither of these would change the limits, of course)

-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


Re: [R] bwplot: how not to draw outliers

2005-01-17 Thread Frank E Harrell Jr
Sundar Dorai-Raj wrote:

RenE J.V. Bertin wrote:
Hello, and (somewhat belated) best wishes for 2005.
Can one order not to draw outliers in bwplot, or at least exclude them 
from the vertical axis scaling? If so, how (or what doc do I need to 
consult)?
The options that have this effect in boxplot() do not appear to have 
any effect with bwplot (although outline=FALSE in boxplot does *not* 
change the scaling).

Thanks,
RenE Bertin

RenE,
There may be other solutions but you can do this using the prepanel 
option to set the ylim:

library(lattice)
set.seed(1)
z - data.frame(x = rt(100, 1), g = rep(letters[1:4], each = 25))
bwplot(x ~ g, z,
   prepanel = function(x, y) {
 bp - boxplot(split(y, x), plot = FALSE)
 ylim - range(bp$stats)
 list(ylim = ylim)
   })
If you actually want to exclude the points (rather than just prevent 
outliers from affecting the scale), you will have to modify the 
panel.bwplot function in addition to using the above.

--sundar
You may also want to try
library(Hmisc)
library(lattice)
bwplot(..., panel=panel.bpplot)
?panel.bpplot
--
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


Re: [R] How do I format something as 0.000?

2005-01-17 Thread Marc Schwartz
On Mon, 2005-01-17 at 14:19 -0600, Dirk Eddelbuettel wrote:
 On Mon, Jan 17, 2005 at 04:49:35PM +0100, Christian Hennig wrote:
  Hi,
  
  I would like to use the format function to get numbers all with three 
  digits to the right of the decimal point, even in cases where there is no
  significant digit left. For example, I would like to get
  c(0.3456789,0.053) as 0.346 0.000.
  It seems that it is not possible to force format to print a 0.000, i.e.
  without any significant decimal places.
  Is it possible to do this somehow in R?
 
 sprintf can do that
 
sprintf(%3.3f %3.3f, 0.3456789, 0.0053)
   [1] 0.346 0.000
 
 You'd have to loop over your vector to do it one by one, I think.

To do this in vectorized fashion, you can use formatC():

x - c(0.3456789, 0.0053)

 formatC(x, format = f, digits = 3)
[1] 0.346 0.000

See ?formatC for more help.

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


[R] a question of mixed effect in R

2005-01-17 Thread chang10000.tw
Dear all,
  I have a question about mixed effect model in R. The data set has
5 variables, X(response),subject, times, repeat, indicator
The model is X_hijk=a_h+Z_h*b_i+r(ij)+e_hijk , where
h=0,1(indicator), i=1,...,n(subject), j=1,...,n_i(times within
subject; nested effect),k=1,2,3(repeat).
Z_h=1 if h=1
   =0 if h=0
b_i~N(0,c^2) random effect of subject
r(ij)~N(0,d^2) random effect of times within subject
e_hijk~N(0,e^2) error term which is independent with the random
effects.

The purpose is to estimate the parameters a_h, c^2,d^2,e^2.
My question is how to fit the model in R; more specifically, how to specify the 
formula of random effect in command lme in R.
Thanks very much for your help.





-
Yahoo!©_¼¯¹q¤l«H½c
[EMAIL PROTECTED]@«H°e·R¤ß¡AYahoo!©_¼¯¨àµ£§U¾Ç­pµe¡C°¨¤W°Ñ¥[
[[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] debian /etc/apt/sources.list for CRAN?

2005-01-17 Thread Christian T. Steigies
On Mon, Jan 17, 2005 at 02:14:04PM -0600, Dirk Eddelbuettel wrote:
 On Mon, Jan 17, 2005 at 01:39:23PM -0500, Michael Friendly wrote:
  Should I just delete the cran.r-project.org line
  above, 
 
 I think so.  Plus, if you already point to Debian unstable, CRAN has nothing
 you wouldn't have otherwise.
 
  or are there debian R packages elsewhere on CRAN that I should 
  include instead?
 
 Not that I know of. 
 
 In the past, CRAN had current Debian packages of R itself for Debian
 flavours other than unstable which typically has the most current R version
 right at release time. However, migration to testing can take time so the we
 sometime kept the same . And for stable we used to have volunteer-donated
 rebuilds of the current R. This has gotten progressively more difficult as
 Debian stable got older and older, and process of creating the R packages
 started to take advantage of facilities to available to the versions of the
 tools in stable.

Not sure if this is still relevant, but the backport I made has been
apt-getable from this address for a while:

deb http://people.debian.org/~cts/debian stable/

I'd prefer if this where integrated in CRAN, but I don't think I can make
that directory available via rsync (unless you are a debian developer).
Probably the debian server can handle the extra load for a few people still
running Debian/stable.
I should be able to keep the packages current, but not necessarily within a
day, like Dirk manages to do.

Christian

__
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] rpart

2005-01-17 Thread Weiwei Shi
Hi, there:
I am working on a classification problem by using
rpart. when my response variable y is binary, the
trees grow very fast, but if I add one more case to y,
that is making y has 3 cases, the tree growing cannot
be finished.
the command looks like:
x-rpart(r0$V142~.,data=r0[,1:141],
parms=list(split='gini'), cp=0.01)

changing cp or removing parms does not help. 

summary($V142) gives like:
 summary(r0$V142)
  0   1   2 
370  14  16 

I am not sure if rpart can do this or there is
something wrong with my approach.

Please be advised.

Ed

__
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] debian /etc/apt/sources.list for CRAN?

2005-01-17 Thread Julien Damon
I think the debian packages are now maintened in the official debian 
repository.

http://packages.debian.org/cgi-bin/search_packages.pl?keywords=r-cransearchon=namessubword=1version=unstablerelease=all
http://packages.debian.org/cgi-bin/search_packages.pl?keywords=r-basesearchon=namessubword=1version=unstablerelease=all
So you don't need a specific entry in your source.list anymore.
--
  Julien Damon [EMAIL PROTECTED]
  http://julien.damon.free.fr
__
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] debian /etc/apt/sources.list for CRAN?

2005-01-17 Thread Dirk Eddelbuettel
On Mon, Jan 17, 2005 at 09:00:53PM +0100, Julien Damon wrote:
 I think the debian packages are now maintened in the official debian 
 repository.

Yes, as they have been since December 1997.

Dirk

-- 
Better to have an approximate answer to the right question than a precise 
answer to the wrong question.  --  John Tukey as quoted by John Chambers

__
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] Weighted least squares

2005-01-17 Thread Ming Hsu
Hi,

I would like to run a weighted least squares with the the weighting matrix
W.  I ran the following two regressions,

(W^-1)Y = Xb + e
Y = WXb+ We

In both cases, E[bhat] = b.

I used the following commands in R

lm1 - lm(Y/W ~ X)
lm2 - lm(Y ~ W:X, weights = W)

where 

Y - rnorm(10,1)
X - Y + rnorm(10,1)
W - 1:10

In lm2, I believe W is applied to the error term, resulting in WLS.  However
the estimated coefficients in lm1 and lm2 are really different.  I tried glm
as well, but the result was the same as lm.

Any advice would be appreciated,

Hsu Ming

__
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] lme confusion

2005-01-17 Thread Ming Hsu
Hi, this is my first time using the nlme package, and I ran into the
following puzzling problem.

I estimated a mixed effects model using lme, once using groupedData, once
explicitly stating the equations.  I had the following outputs.  All the
coefficients were similar, but they're always slightly different, making me
think that it's not due to numerical error.

Also, what is the Corr field in the Random Effects output?  Is it the
correlation between the various regressors?

Here are the outputs.

1. Linear mixed-effects model fit by REML
 Data: groupedData(dPx ~ EMX + EMY | Session, data = X.cen)
   AIC BIClogLik
  834.1692 862.532 -407.0846

Random effects:
 Formula: ~EMX + EMY | Session
 Structure: General positive-definite
StdDevCorr
(Intercept) 1.0205525 (Intr) EMX
EMX 0.2708627  1
EMY 0.2795289 -1 -1
Residual5.5076376

Fixed effects: dPx ~ EMX + EMY
 Value Std.Error  DF   t-value p-value
(Intercept)  1.3011219 0.6807083 121  1.911423  0.0583
EMX  0.7878296 0.2539316 121  3.102526  0.0024
EMY -0.1566070 0.1534066 121 -1.020862  0.3094
 Correlation: 
(Intr) EMX   
EMX  0.151   
EMY -0.573 -0.092

Standardized Within-Group Residuals:
Min  Q1 Med  Q3 Max
-3.00618687 -0.23680151 -0.03431868  0.15386198  6.27114243

Number of Observations: 129
Number of Groups: 6

===

2. Linear mixed-effects model fit by REML
 Data: X.cen 
  AIC  BIClogLik
  834.457 862.8199 -407.2285

Random effects:
 Formula: ~EMX + EMY | Session
 Structure: General positive-definite, Log-Cholesky parametrization
StdDevCorr
(Intercept) 1.0101137 (Intr) EMX
EMX 0.2108649  0.857
EMY 0.2995491 -0.944 -0.882
Residual5.5104113

Fixed effects: dPx ~ EMX + EMY
 Value Std.Error  DF   t-value p-value
(Intercept)  1.3062194 0.6823464 121  1.914305  0.0579
EMX  0.7612238 0.2440504 121  3.119125  0.0023
EMY -0.1677985 0.1618076 121 -1.037025  0.3018
 Correlation: 
(Intr) EMX   
EMX  0.059   
EMY -0.552 -0.002

Standardized Within-Group Residuals:
Min  Q1 Med  Q3 Max
-3.00604994 -0.24210830 -0.01660797  0.14846499  6.27931955

Number of Observations: 129
Number of Groups: 6

__
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] Why can't run Gamma Distribution by GLM?

2005-01-17 Thread may sawasdee
 y-cy-c(15,16,17,0,20,50,0,11,60,12)
 x-c(1,6,3,11,13,20,12,14,15,3)
 gamma-glm(y~x,family=Gamma())
Error in eval(expr, envir, enclos) : Non-positive values not allowed for the 
gamma family
but if i change data of y is 
 y1-c(15,16,17,12,20,50,51,11,60,12)  ## doesn't have zero then I can run.
 
Gamma Distribution can run for y = o ??
I would like to know, why?
 
Thand and Best regards,
Mathinee 
 
 

 


-

 Meet the all-new My Yahoo! – Try it today! 
[[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


[R] X11 installation problem Linux X86_64

2005-01-17 Thread Robert Nelson
Hello all,
This is my first time posting, so forgive my ignorance.  I've searched high 
and low but haven't come across the specific answer to my questions.

configure runs fine, then make gives this error:
...
gcc -shared -L/usr/local/lib -o R_X11.so  dataentry.lo devX11.lo rotated.lo 
rbitmap.lo   -L/usr/X11R6/lib -lX11  -ljpeg -lpng -lz  -lreadline -ldl 
-lncurses -lm
/usr/bin/ld: skipping incompatible /usr/X11R6/lib/libX11.so when searching 
for -lX11
/usr/bin/ld: skipping incompatible /usr/X11R6/lib/libX11.a when searching 
for -lX11
/usr/bin/ld: cannot find -lX11
collect2: ld returned 1 exit status
make[4]: *** [R_X11.so] Error 1
make[4]: Leaving directory `/root/R-2.0.1/src/modules/X11'
...

This is a 64-bit machine, so I'm wondering if the problem stems from make 
not looking in the /usr/X11R6/lib64 directory, as opposed to 
/usr/X11R6/lib64.  Both dirs are in /etc/ld.so.conf.  I also tried 
configure --x-libraries=/usr/X11R6/lib64, but that produced the same 
error.  I believe that I have all the requisite packages installed.  Could 
someone please point me in the right direction?  Thanks in advance

-Robert
__
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] 3d bar plot

2005-01-17 Thread Lorenz . Gygax
 This graph - 
 http://www.math.hope.edu/~tanis/dallas/images/disth36.gif
 is an example I found at
 http://www.math.hope.edu/~tanis/dallas/disth1.html
 created by Maple.
 
 Does anybody know how to create something similar in R?
 
 I have a feeling it could be possible using scatterplot3d
 (perhaps with type=h, the fourth example in help('scatterplot3d')?),
 but I cannot figure it out.

Sorry to butt in with a more fundamental question. Is this really the kind
of graph we want to cultivate and support? In my oppinion, it is hardly ever
necessary to have a graph in 3D or even in higher dimensions (one certain
exception is if one tries to spin a higly dimensional dataset in search of
patterns as you can do in ggobi and there might certainly be others).

At least the graph presented in the example does - in my eyes - not warrant
a 3D plot. Why not just draw curves for each of the n's in a plot of 'A'
against 'row'? This would enable a reader to make straightforward
comparisons of the curves and allow to estimate the height of the 'columns'
along the 'A'-axis much more easily.

Only because we can easily create 3D graphs, I do not believe that we should
use them often. Only if a careful evaluation of alternatives was not
promising success I would resign myself to using 3D graphs.

Lorenz
- 
Lorenz Gygax, Dr. sc. nat.
Centre for proper housing of ruminants and pigs
Swiss Federal Veterinary Office
agroscope FAT Tänikon, CH-8356 Ettenhausen / Switzerland

__
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] 3d bar plot

2005-01-17 Thread Marwan Khawaja
Dear John,
Yes, I meant the scatter3d function in the Rcmdr package -- I will 'behave' next
time :-)
Jonne asked for 'something similar in R' -- hence the suggestion to also use the
package scatterplot3d.

Best Marwan

 
---
Marwan Khawaja http://staff.aub.edu.lb/~mk36/
---

 -Original Message-
 From: John Fox [mailto:[EMAIL PROTECTED] 
 Sent: Monday, January 17, 2005 3:49 PM
 To: 'Marwan Khawaja'; 'R user'
 Cc: r-help@stat.math.ethz.ch
 Subject: RE: [R] 3d bar plot
 
 Dear Marwan and Jonne,
 
 I don't think that there's a scatter3d package, so perhaps 
 Marwan is referring to the scatter3d() function in the Rcmdr 
 package. If so, that function won't make the kind of 3D graph 
 that Jonne wants -- though the rgl package, on which 
 scatter3d() is based, should be able to create the graph. 
 
 I don't believe that the scatterplot3d() function in the 
 scatterplot3d package can make the plot either, but I may be wrong.
 
 I hope this helps.
 
 John
 
 
 John Fox
 Department of Sociology
 McMaster University
 Hamilton, Ontario
 Canada L8S 4M4
 905-525-9140x23604
 http://socserv.mcmaster.ca/jfox
  
 
  -Original Message-
  From: [EMAIL PROTECTED] 
  [mailto:[EMAIL PROTECTED] On Behalf Of 
 Marwan Khawaja
  Sent: Sunday, January 16, 2005 7:04 PM
  To: 'R user'; r-help@stat.math.ethz.ch
  Subject: RE: [R] 3d bar plot
  
  You can check these packages,
  ?scatterplot3d
  ?scatter3d
  
  Best Marwan
  
   
  ---
  Marwan Khawaja http://staff.aub.edu.lb/~mk36/
  ---
  
   -Original Message-
   From: [EMAIL PROTECTED] 
   [mailto:[EMAIL PROTECTED] On Behalf Of R user
   Sent: Monday, January 17, 2005 12:37 PM
   To: r-help@stat.math.ethz.ch
   Subject: [R] 3d bar plot
   
   This graph -
   http://www.math.hope.edu/~tanis/dallas/images/disth36.gif
   is an example I found at
   http://www.math.hope.edu/~tanis/dallas/disth1.html
   created by Maple.
   
   Does anybody know how to create something similar in R?
   
   I have a feeling it could be possible using scatterplot3d 
 (perhaps 
   with type=h, the fourth example in help('scatterplot3d')?), but I 
   cannot figure it out.
   
   Thanks in advance,
   Jonne.
   
   __
   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-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] rpart

2005-01-17 Thread Prof Brian Ripley
On Mon, 17 Jan 2005, Weiwei Shi wrote:
I am working on a classification problem by using
rpart. when my response variable y is binary, the
trees grow very fast, but if I add one more case to y,
that is making y has 3 cases,
Do you mean 3 classes?: you have many more than 3 cases below.
the tree growing cannot be finished.
Whatever does that mean?  Please see the posting guide and supply the 
information it asks for, a reproducible example and what happens when you 
run it and why you think it is wrong.

the command looks like:
x-rpart(r0$V142~.,data=r0[,1:141],
parms=list(split='gini'), cp=0.01)
changing cp or removing parms does not help.
summary($V142) gives like:
summary(r0$V142)
 0   1   2
370  14  16
I am not sure if rpart can do this or there is something wrong with my 
approach.
What is `this' you want to do?  Rpart works well with multiple classes: 
see for example MASS4.

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


Re: [R] Weighted least squares

2005-01-17 Thread Prof Brian Ripley
On Mon, 17 Jan 2005, Ming Hsu wrote:
I would like to run a weighted least squares with the the weighting 
matrix W.
This is generalized not weighted least squares if W really is a matrix and 
not a vector of case-by-case weights.

I ran the following two regressions,
(W^-1)Y = Xb + e
Y = WXb+ We
If W is a diagonal matrix, the weights for the second are W^(-2) and you 
used W below.

In both cases, E[bhat] = b.
I used the following commands in R
lm1 - lm(Y/W ~ X)
lm2 - lm(Y ~ W:X, weights = W)
where
Y - rnorm(10,1)
X - Y + rnorm(10,1)
W - 1:10
That W is not a matrix!
In lm2, I believe W is applied to the error term, resulting in WLS.  However
the estimated coefficients in lm1 and lm2 are really different.  I tried glm
as well, but the result was the same as lm.
Any advice would be appreciated,
Please do check that you supply an example that agrees with your words.
Use lm.gls in MASS or gls in nlme for generalized least squares, if that 
is what you meant.

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