[R] how to replace some objects?

2006-12-19 Thread Zhang Jian
I want to replace some objects in one row or column.For example,
One colume: a,b,a,c,b,b,a,a,c.
I want to replace a with 1, b with 2, and c with 3.
Like this: 1,2,1,3,2,2,1,1,3.

How to do it? I donot know how to do it. Thanks.

[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] how to replace some objects?

2006-12-19 Thread Jacques VESLOT
you can use as.numeric(factor( )); in your example:
  ex - sample(letters[1:3], 10, T)
  ex
  [1] b b c b a a b b a a

  as.numeric(factor(ex))
  [1] 2 2 3 2 1 1 2 2 1 1

if the order is different, use levels:

  as.numeric(factor(ex, levels=letters[3:1]))
  [1] 2 2 1 2 3 3 2 2 3 3

---
Jacques VESLOT

CNRS UMR 8090
I.B.L (2ème étage)
1 rue du Professeur Calmette
B.P. 245
59019 Lille Cedex

Tel : 33 (0)3.20.87.10.44
Fax : 33 (0)3.20.87.10.31

http://www-good.ibl.fr
---

Zhang Jian a écrit :
 I want to replace some objects in one row or column.For example,
 One colume: a,b,a,c,b,b,a,a,c.
 I want to replace a with 1, b with 2, and c with 3.
 Like this: 1,2,1,3,2,2,1,1,3.
 
 How to do it? I donot know how to do it. Thanks.
 
   [[alternative HTML version deleted]]
 
 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.


__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] A question about debug package

2006-12-19 Thread Tong Wang
Hi all,
 I am using the debug package, and I would like some commands executed 
automatically as I quit by qqq( ),  
I tried the on.exit( ) , but it doesn't work in this case.   Any suggestions on 
this?   
 
thanks a lot .

tong

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] how to replace some objects?

2006-12-19 Thread Zhang Jian
The example is simply.But the other example:
One column: acba,coma,acmo,acmo,acba,coma
I want to replace acba with aaa, coma with bbb, and acmo with
ddd.
Like this: aaa,bbb,ddd,ddd,aaa,bbb
How to do it?
Thanks.


On 12/19/06, Jacques VESLOT [EMAIL PROTECTED] wrote:

 you can use as.numeric(factor( )); in your example:
  ex - sample(letters[1:3], 10, T)
  ex
 [1] b b c b a a b b a a

  as.numeric(factor(ex))
 [1] 2 2 3 2 1 1 2 2 1 1

 if the order is different, use levels:

  as.numeric(factor(ex, levels=letters[3:1]))
 [1] 2 2 1 2 3 3 2 2 3 3

 ---
 Jacques VESLOT

 CNRS UMR 8090
 I.B.L (2ème étage)
 1 rue du Professeur Calmette
 B.P. 245
 59019 Lille Cedex

 Tel : 33 (0)3.20.87.10.44
 Fax : 33 (0)3.20.87.10.31

 http://www-good.ibl.fr
 ---

 Zhang Jian a écrit :
  I want to replace some objects in one row or column.For example,
  One colume: a,b,a,c,b,b,a,a,c.
  I want to replace a with 1, b with 2, and c with 3.
  Like this: 1,2,1,3,2,2,1,1,3.
 
  How to do it? I donot know how to do it. Thanks.
 
[[alternative HTML version deleted]]
 
  __
  R-help@stat.math.ethz.ch mailing list
  https://stat.ethz.ch/mailman/listinfo/r-help
  PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
  and provide commented, minimal, self-contained, reproducible code.
 


[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] how to replace some objects?

2006-12-19 Thread Jacques VESLOT
similarly:
as.character(factor(c(abca,coma),labels=c(aaa,bbb)))
---
Jacques VESLOT

CNRS UMR 8090
I.B.L (2ème étage)
1 rue du Professeur Calmette
B.P. 245
59019 Lille Cedex

Tel : 33 (0)3.20.87.10.44
Fax : 33 (0)3.20.87.10.31

http://www-good.ibl.fr
---


Zhang Jian a écrit :
 The example is simply.But the other example:
 One column: acba,coma,acmo,acmo,acba,coma
 I want to replace acba with aaa, coma with bbb, and acmo with 
 ddd.
 Like this: aaa,bbb,ddd,ddd,aaa,bbb
 How to do it?
 Thanks.
 
  
 On 12/19/06, *Jacques VESLOT* [EMAIL PROTECTED] 
 mailto:[EMAIL PROTECTED] wrote:
 
 you can use as.numeric(factor( )); in your example:
   ex - sample(letters[1:3], 10, T)
   ex
 [1] b b c b a a b b a a
 
   as.numeric(factor(ex))
 [1] 2 2 3 2 1 1 2 2 1 1
 
 if the order is different, use levels:
 
   as.numeric(factor(ex, levels=letters[3:1]))
 [1] 2 2 1 2 3 3 2 2 3 3
 
 ---
 Jacques VESLOT
 
 CNRS UMR 8090
 I.B.L (2ème étage)
 1 rue du Professeur Calmette
 B.P. 245
 59019 Lille Cedex
 
 Tel : 33 (0)3.20.87.10.44
 Fax : 33 (0)3.20.87.10.31
 
 http://www-good.ibl.fr
 ---
 
 Zhang Jian a écrit :
   I want to replace some objects in one row or column.For example,
   One colume: a,b,a,c,b,b,a,a,c.
   I want to replace a with 1, b with 2, and c with 3.
   Like this: 1,2,1,3,2,2,1,1,3.
  
   How to do it? I donot know how to do it. Thanks.
  
 [[alternative HTML version deleted]]
  
   __
   R-help@stat.math.ethz.ch mailto:R-help@stat.math.ethz.ch
 mailing list
   https://stat.ethz.ch/mailman/listinfo/r-help
   PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
   and provide commented, minimal, self-contained, reproducible code.
  
 


__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] proc GLM with R

2006-12-19 Thread Michael Dewey
At 05:15 18/12/2006, Cressoni, Massimo \(NIH/NHLBI\) [F] wrote:
I want to migrate from SAS to R.
I used proc mixed to do comparison between multiple groups and to perform
multiple comparison between groups since, as far as I know, proc 
mixed does not make assumptions about the data and so
it is better than a simple anova (data must only be normal).
Es. how can I translate a code like this (two way anova with a factor of
repetition) :


proc mixed;
class kind  PEEP codice;
model PaO2_FiO2 = kind PEEP kind*PEEP;
repeated /type = un sub=codice;
lsmeans kind*PEEP /adjust=bon;
run;

codice is a unique identifier of patient
kind is a variable which subdivided the patient (i.e. red or brown hairs)
PEEP is positive end expiratory pressure. These are the steps of a clinical
trial. Patient did the trial at PEEP = 5 and PEEP = 10

You could investigate either nlme or lme4
The best documentation for nlme (which should be included in your system) is
@BOOK{pinheiro00,
   author = {Pinheiro, J C and Bates, D M},
   year = 2000,
   title = {Mixed-effects models in {S} and {S-PLUS}},
   publisher = {Springer-Verlag},
   address = {New York},
   keywords = {glm; mixed models}
}
lme4 is a more recent development by Bates which as yet has slightly 
fewer helper functions and no book.

Since you are assuming normal error you can use nlme. I am afraid I 
do not read SAS so I think it would be wrong of me to try to 
translate your example (traddutore, traditore and all that)


Thank you

Massimo Cressoni

run;

Michael Dewey
http://www.aghmed.fsnet.co.uk

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] how to replace some objects?

2006-12-19 Thread Michael Kubovy
On Dec 19, 2006, at 3:05 AM, Zhang Jian wrote:

 I want to replace some objects in one row or column.For example,
 One colume: a,b,a,c,b,b,a,a,c.
 I want to replace a with 1, b with 2, and c with 3.
 Like this: 1,2,1,3,2,2,1,1,3.

let - c('a', 'b', 'a', 'c', 'b', 'b', 'a', 'a', 'c')
library(car)
num - recode(let,  'a' = 1; 'b' = 2; else = 3 )

_
Professor Michael Kubovy
University of Virginia
Department of Psychology
USPS: P.O.Box 400400Charlottesville, VA 22904-4400
Parcels:Room 102Gilmer Hall
 McCormick RoadCharlottesville, VA 22903
Office:B011+1-434-982-4729
Lab:B019+1-434-982-4751
Fax:+1-434-982-4766
WWW:http://www.people.virginia.edu/~mk9y/

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] configure help

2006-12-19 Thread Fridolin Wild

Hello,

as I just spent a (too long) while searching
for a way how to persistantly switch back the help display
routines from chm to text, here a small documentation
how to do that with the windows version of R.

The windows installer asks which help type
you want to use, I wanted to test the chm
version -- which I didn't like.

If you after installation want to switch back,
you have to edit

 myRdirectory\etc\Rprofile.site 

and change the line

options(chmhelp=TRUE)

back to

options(chmhelp=FALSE)

It would be nice if -- in a future release -- this
also could be changed in the GUI settings.

Best,
Fridolin

-- 
Fridolin Wild, Institute for Information Systems and New Media,
Vienna University of Economics and Business Administration (WUW),
Augasse 2-6, A-1090 Wien, Austria
fon +43-1-31336-4488, fax +43-1-31336-746

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] configure help

2006-12-19 Thread Brian Ripley
On Tue, 19 Dec 2006, Fridolin Wild wrote:


 Hello,

 as I just spent a (too long) while searching
 for a way how to persistantly switch back the help display
 routines from chm to text, here a small documentation
 how to do that with the windows version of R.

 The windows installer asks which help type
 you want to use, I wanted to test the chm
 version -- which I didn't like.

 If you after installation want to switch back,
 you have to edit

 myRdirectory\etc\Rprofile.site 

 and change the line

options(chmhelp=TRUE)

 back to

options(chmhelp=FALSE)

 It would be nice if -- in a future release -- this
 also could be changed in the GUI settings.

But it has nothing to do with the GUI preferences: it applies to the 
command-line version of R as well.

What about ?help did you not understand? It says

   chmhelp = getOption(chmhelp),
   ...
  chmhelp: logical (or 'NULL'). Only relevant under Windows. If 'TRUE'
   the Compiled HTML version of the help on the topic will be
   shown in a help viewer.

so you need to set options(chmhelp=FALSE): it is up to you where you set 
it.

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

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] 1-D Image as label?

2006-12-19 Thread Gav Wood
I have a data set for visualisation that comprises several sets of 1-D 
points over a given time span (the time span of the experiment). These 
are basically just several variable-length arrays of values whose units 
are seconds.

I have several sets of further data relating to the nature of the 
experiment; Each describes each second in the experiment with an RGB 
colour triplet; this amounts to a 1 dimensional bitmap image whose axis 
is the same time axis of the former data set.

I envisage one possible visualisation with the X axis (time) being 
annotated with one set of the colours from the latter data set. The Y 
axis would be either a histogram of the points from the former dataset, 
or (better, since the points are somewhat imprecise) a probability 
density function over time, derived from the gathered times themselves 
but assuming each represents an event that happened somewhere close to 
it. I am looking into using a density estimation function for this, as 
described in http://en.wikipedia.org/wiki/Density_estimation

This brings me to my question;

What would be the easiest way of annotating an axis with an array of 
colour triplets?

Thanks for any insights/information you can offer,

Gav

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Random Effects Model

2006-12-19 Thread Mike Dunbar
Hi Ryan

Your model code suggests that Type is a variable that you have in your FREE 
data frame, but you don't mention it, that is probably part of your problem?

The second question is how are your data structured? Sex goes in the fixed part 
of the model. Swimmer is almost certainly goes in the random component, as you 
have identified. The question is what to do with Swim. This could either be the 
key variable of interest or simply a label representing replicates. What is the 
hypothesis you're trying to test? When swimmers 1..n undertake swim 1 is this 
all at the same time? If this is the case, do you have reason to believe that 
there could be some similarlites (not sure what, maybe temperature, wind 
conditions, fatigue) between swimmers on the same swim? 

Without information on the data structure then its difficult to suggest 
anything further. As a first guess you could try comparing:

m1 - lme(Difference~Sex, random=~1|Swimmer, data=FREE)
m2 - lme(Difference~Sex, random=~1|Swimmer/Swim, data=FREE)

With Swim in the fixed component of the model you're suggesting a linear 
relationship between Difference and Swim, are you sure this is what you want? 
If you really think Swim should be in the fixed compoent then you might want to 
compare:

m3 - lme(Difference~Sex*Swim, random=~1|Swimmer, data=FREE)
m4 - lme(Difference~Sex*Swim, random=~Swim|Swimmer, data=FREE)

The latter will fit an overall relationship between Difference and Swim, and 
then estimate both intercept and slope random effects for Swim.

regards

Mike D


 [EMAIL PROTECTED] 19/12/2006 03:18 
Hello,

I am new to R, and I am trying to figure out how to use it for a  
random effects model. I am using version 2.4.0, and I also have the  
book Applied Linear Regression by Sanford Weisberg.

I have four variables: Swimmer, Sex, Swim, and Difference.  Swimmer  
identifies the number assigned to a particular person. Sex is  
male/female. Swim identifies the number swim from 1 to 6. Difference  
is my variable of interest (random).

The book says I should run something like this:

 library(nlme)
 data(FREE) #FREE is my dataset
 xyplot(Difference~Swim|Type, group=Swimmer, data=FREE,
+ panel.groups=function(x,y,...){
+   panel.linejoin(x,y,horizontal=FALSE,...)}
+ )
 m1 - lme(Difference~Swim+Type, data=FREE, random=~1+Type|Swimmer)
 m2 - update(m1, random=~1|Swimmer)

I've pretty much decided that xyplot doesn't work. Instead, I think  
plot will work much better.  I keep getting errors about Type. Can  
someone explain this to me? Does the code above look right?

Any kind of help will be appreciated...

Thanks in advance!

Ryan

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help 
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html 
and provide commented, minimal, self-contained, reproducible code.


-- 
This message (and any attachments) is for the recipient only...{{dropped}}

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] configure help

2006-12-19 Thread Fridolin Wild

Hey Brian,

 But it has nothing to do with the GUI preferences: it applies to the 
 command-line version of R as well.

I was suspecting this argument ;) -- however, I think
from a usability point of view it should be possible
to re-set the default setting also somewhere *within*
the GUI if the GUI installer allows to set it. Maybe
in a different place?

 What about ?help did you not understand? It says

That is where I found how to set it (for my current
workspace). Finding where I can set it *permanently*
was more difficult (especially when you never had
the need to mingle with R-profiles before).

That's why I decided to document it here in the
mailinglist just in case others have troubles
finding it, too.

Best,
Fridolin

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Problem in Dates

2006-12-19 Thread Gabor Grothendieck
Read R News 4/1 help desk article and the last line of every message to r-help.
Also putting POSIXlt objects into data frames is asking for trouble.

On 12/19/06, Shubha Karanth [EMAIL PROTECTED] wrote:
 Hi Experts,



 I have a problem in Dates.



 I have a zoo object called 'intra'. And the class of index(intra) is
 (Chron Dates Time). I need to put the index of this zoo object into a
 data frame. So I used,



 idat-data.frame(Datetime=as.POSIXlt(index(intra),GMT))





 But I get the values of 'idat' to be:



 01joulu2006 09:59:59

 01joulu2006 10:09:59

 01joulu2006 10:19:59

 01joulu2006 10:30:00

 01joulu2006 10:40:00

 01joulu2006 10:50:00





 But I need the 'idat' format to be:



 2006-12-01 13:30:00

 2006-12-01 13:40:00

 2006-12-01 13:50:00

 2006-12-01 14:00:00

 2006-12-01 14:10:00

 2006-12-01 14:19:59

 2006-12-01 14:29:59





 i.e., instead of joulu (The finnish version of December) I need to get in
 the number format. How do I do this? Do I need to change the OS date format?



 Because I read a documentation which says Unfortunately, the documentation
 of POSIXt objects is Operating system dependent and especially under MS
 Windows several problems appear in the management of time zones and day
 light saving times (Source: R Documentation, timeDate Class). Thought this
 may help you…



 Thank you,

 Shubha.

[[alternative HTML version deleted]]



 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.




__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] A question on lmer() function

2006-12-19 Thread Douglas Bates
On 12/17/06, Guojing Yang [EMAIL PROTECTED] wrote:
 Dear R users,
  We have encountered a slight problem when using the lmer()
 function:

   1. Data description: 11 locations; Nt: monthly mosquito population
 density from 1994-2005 in each location.
   2. Question: to examine the degree of spatial heterogeneity in the
 system by testing model support for single versus multiple intercepts
 and slopes for the location effect. We applied the lmer() function and
 introduced location as spatial effect. Four different models were
 generated as following:
 a.  1 intercept  1 slope :  lmer(r~log(N)+(1|location)), where r -
 log(Nt/Nt-1) and location is a random effect.
 b.  Multi-intercept  1 slope: lmer(r~location+log(N)+(1|location))
 c.  1 slope  multi-intercept: ??
 d.  Multi-intercept  multi-slope:
 lmer(r~location*log(N)+(1|location))

I'm not exactly sure what you want to do here but you definitely
should not have location as a fixed-effects term and a random effects
term of the form (1|location).  Such terms would be confounded.

I think the models you want to fit would all have an (implicit)
intercept and a log(N) term in the fixed effects.  They would differ
in terms of whether you have a random effect for the intercept by
location and/or a random effect for the slope with respect to log(N)
by location.  Four variants are

#  random effects for intercept only
lmer(r ~ log(N) + (1|location))

# random effects for slope only
lmer(r ~ log(N) + (0+log(N)|location))

# possibly correlated random effects for intercept and slope
lmer(r ~ log(N) + (log(N)|location))

# independent random effects for intercept and slope
lmer(r ~ log(N) + (1|location) + (0+log(N)|location))

 As you can see, we have had trouble defining model c. Does anyone know
 how to code this using lmer? We really appreciate any response.
 Guojing


 [[alternative HTML version deleted]]

 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.


__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] nonparametric significance test for one sample

2006-12-19 Thread HelponR
Hello, Gurus:

I tried to test if the sample mean of a dataset is zero.

The data has 1500 numbers with a lot of zeros and some small
positive numbers. The data range on [0,1] but the distribution is unknown.
It is zero inflated anyway.

I tried to use the  Wilcoxon Signed Ranks test. But I read from this website
that it does assume the population pdf is symmetric.

http://www.cas.lancs.ac.uk/glossary_v1.1/nonparam.html#wsrt
The Wilcoxon Signed Ranks test does not require the assumption that the
population is normally distributed. In many applications, this test is used
in place of the one sample
t-testhttp://www.cas.lancs.ac.uk/glossary_v1.1/hyptest.html#1samptwhen
the normality assumption is questionable. It is a more powerful
alternative to the sign test, but does assume that the population
probability distribution is symmetric.

I wonder if wilcox.test( ) in R also assumes the symmetric pdf?

I checked the sign test too. But the sign *test* is not *testing
equality*of population


If wilcox.test() cannot work for my data, I wonder if you could suggest a
kind of test? I already tried t-test (assume normality) but I want to find
something else.

Many thanks!

S

[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Neural Network with Multiple Outputs

2006-12-19 Thread Ralf Finne
Hi! I want to use an artificial neural network of
type MLP (Multi Level Perception) as a kind of
generalized regression.  In this case there are several
binary outputs.  I have been using Matlab with
good results.  But has anybody found a good
package in R.
Ralf Finne
SYH University of Applied Sciences, Finland

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Replacing values

2006-12-19 Thread John Kane

--- downunder [EMAIL PROTECTED] wrote:

 
 Hi all,
 
 I have to recode some values in a dataset. for
 example changing all zeros to
 . or 999 would be also ok. does anybody know how
 to do this? thanks in
 advance. lars

Hi Lars.
Marc has warned you about . 999 vs NA 

A couple of approachs:
aa - c(2,3,5,7,7, 3)
aa[aa==7] - 5
aa

or
library(car)
?recode

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] xaxt=n for image()

2006-12-19 Thread javier garcia-pintado
Hi,
The argument xaxt=n for removing the x axis from a image plot does not
work for me.
I'm really using a function called plot.grassmeta() in library GRASS
that is a wrapper for image(), but it seems to me that the problem is
not in plot.grassmeta() but in image().

If I'm right could you tell me if there is a way to remove one axis from
a call to image()?

Thanks and wishes,

Javier
-

-- 
Javier García-Pintado
Institute of Earth Sciences Jaume Almera (CSIC)
Lluis Sole Sabaris s/n, 08028 Barcelona
Phone: +34 934095410
Fax:   +34 934110012
e-mail:[EMAIL PROTECTED] 

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] configure help

2006-12-19 Thread ahmad ajakh
Hi All,

I ma running R under windows with xemacs and ESS.
The Rprofile.site options, somehow gets overridden by xemacs and my options
in Rprofile.site are not taken into account while they are when I use Rgui.
How can I specify my options if I am using xemacs? and what configuration file
xemacs+ess use for R.
Thanks
AA

- Original Message 
From: Brian Ripley [EMAIL PROTECTED]
To: Fridolin Wild [EMAIL PROTECTED]
Cc: r-help@stat.math.ethz.ch
Sent: Tuesday, December 19, 2006 7:15:11 AM
Subject: Re: [R] configure help

On Tue, 19 Dec 2006, Fridolin Wild wrote:


 Hello,

 as I just spent a (too long) while searching
 for a way how to persistantly switch back the help display
 routines from chm to text, here a small documentation
 how to do that with the windows version of R.

 The windows installer asks which help type
 you want to use, I wanted to test the chm
 version -- which I didn't like.

 If you after installation want to switch back,
 you have to edit

 myRdirectory\etc\Rprofile.site 

 and change the line

options(chmhelp=TRUE)

 back to

options(chmhelp=FALSE)

 It would be nice if -- in a future release -- this
 also could be changed in the GUI settings.

But it has nothing to do with the GUI preferences: it applies to the 
command-line version of R as well.

What about ?help did you not understand? It says

   chmhelp = getOption(chmhelp),
   ...
  chmhelp: logical (or 'NULL'). Only relevant under Windows. If 'TRUE'
   the Compiled HTML version of the help on the topic will be
   shown in a help viewer.

so you need to set options(chmhelp=FALSE): it is up to you where you set 
it.

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

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Problem with glmmADMB

2006-12-19 Thread Michael Kubovy
library(glmmADMB)
#Example for   glmm.admb
data(epil2)
glmm.admb(y~Base*trt+Age 
+Visit,random=~Visit,group=subject,data=epil2,family=nbinom)

Gives:
Error in glmm.admb(y ~ Base * trt + Age + Visit, random = ~Visit,  
group = subject,  :
The function maximizer failed

**
R version 2.4.1 RC (2006-12-14 r40181)
powerpc-apple-darwin8.8.0

locale:
C

attached base packages:
[1] utils stats graphics  grDevices datasets   
methods   base

other attached packages:
glmmADMB   JGRiplotsJavaGD rJava  MASS   lattice
 0.3  1.4-14   1.0-5   0.3-5  0.4-12  7.2-30 0.14-16

_
Professor Michael Kubovy
University of Virginia
Department of Psychology
USPS: P.O.Box 400400Charlottesville, VA 22904-4400
Parcels:Room 102Gilmer Hall
 McCormick RoadCharlottesville, VA 22903
Office:B011+1-434-982-4729
Lab:B019+1-434-982-4751
Fax:+1-434-982-4766
WWW:http://www.people.virginia.edu/~mk9y/

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Summary Tables for t.test?

2006-12-19 Thread Robert Lischke
Hi there,

kind of a newbie-question, but anyway: is there a way to aggregate a
nice table with input and results of a t-Test?

I'm looking for something like a summary of Mean, Median, SD (seperated
for both distributions) and p-value, df, etc. for the t-Test.

I'm asking because i need a dozen of them and want to avoid putting
those together by hand (output as LaTeX would be a nice extra ;)

Best Greetings,



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


[R] R 2.4.1 changes for SuSE users

2006-12-19 Thread Detlef Steuer
Hi UseRs!

RPMs for SuSE Versions 9.3 to 10.2 and bleeding edge aka openSUSE_Factory
are available at

http://software.opensuse.org/download/home:/dsteuer/

as I shifted the creation of these packages onto the Opensuse Build Service 
compiler farm.
You can use the directories therein as installation sources for the respective 
versions of SuSE Linux.

My goal is to put R-base back onto (open)suse's installation DVD, as it was a 
long, long time ago. Well, may be before there were DVDs :-)
As the opensuse developers will take into account the usage of their repository 
to determine what new packages to include, I recommend using opensuse.org to 
download the R packages. Besides R-base you'll  find littler and emacs-ess rpms 
for download. 
R-patched and R-devel will be added soon .

I will not, for the moment, maintain the CRAN directories as installation 
sources, only as a repository for downloading rpms for a manual install. (There 
were strange problems anyway ...) So CRAN will stay complete, but I´ll use the 
comfort of the build service by opensuse.
If the build service will stop some day, I´ll once again start to put proper 
installation sources on CRAN.

Happy R´ing!
Detlef

---
Detlef Steuer
Helmut-Schmidt-Universität Hamburg
FB WOW
[EMAIL PROTECTED]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Problem with glmmADMB

2006-12-19 Thread H. Skaug
glmmADMB only runs under two operating systems: Windows and Linux.

hans

___


Michael Kubovy wrote:

library(glmmADMB)

#Example for glmm.admb

data(epil2)

glmm.admb(y~Base*trt+Age

+Visit,random=~Visit,group=subject,data=epil2,family=nbinom)

Gives:

Error in glmm.admb(y ~ Base * trt + Age + Visit, random = ~Visit,

group = subject, :

The function maximizer failed

**

R version 2.4.1 RC (2006-12-14 r40181)

powerpc-apple-darwin8.8.0

locale:

C

attached base packages:

[1] utils stats graphics grDevices datasets

methods base

other attached packages:

glmmADMB JGR iplots JavaGD rJava MASS lattice

0.3 1.4-14 1.0-5 0.3-5 0.4-12 7.2-30 0.14-16

_

Professor Michael Kubovy

University of Virginia

Department of Psychology

USPS: P.O.Box 400400 Charlottesville, VA 22904-4400

Parcels: Room 102 Gilmer Hall

McCormick Road Charlottesville, VA 22903

Office: B011 +1-434-982-4729

Lab: B019 +1-434-982-4751

Fax: +1-434-982-4766

WWW: 
*http://www.people.virginia.edu/~mk9y/*http://www.people.virginia.edu/~mk9y/

[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Fwd: nonparametric significance test for one sample

2006-12-19 Thread HelponR
-- Forwarded message --
From: HelponR [EMAIL PROTECTED]
Date: Dec 19, 2006 9:28 AM
Subject: nonparametric significance test for one sample
To: r-help r-help@stat.math.ethz.ch

Hello, Gurus:

I tried to test if the sample mean of a dataset is zero.

The data has 1500 numbers with a lot of zeros and some small
positive numbers. The data range on [0,1] but the distribution is unknown.
It is zero inflated anyway.

I tried to use the  Wilcoxon Signed Ranks test. But I read from this website
that it does assume the population pdf is symmetric.

http://www.cas.lancs.ac.uk/glossary_v1.1/nonparam.html#wsrt
The Wilcoxon Signed Ranks test does not require the assumption that the
population is normally distributed. In many applications, this test is used
in place of the one sample
t-testhttp://www.cas.lancs.ac.uk/glossary_v1.1/hyptest.html#1samptwhen
the normality assumption is questionable. It is a more powerful
alternative to the sign test, but does assume that the population
probability distribution is symmetric.

I wonder if wilcox.test( ) in R also assumes the symmetric pdf?

I checked the sign test too. But the sign *test* is not *testing
equality*of population


If wilcox.test() cannot work for my data, I wonder if you could suggest a
kind of test? I already tried t-test (assume normality) but I want to find
something else.

Many thanks!

S

[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] effect plot

2006-12-19 Thread Ambrogi Federico
Dear R users,

Is there a simple way to use the effect function (library(effects)) with
a GEE estimated model?

 

library(gee)

library(MASS)

library(effects)

attach(epil)

 

b = gee(y ~ lbase*trt + lage + V4, family=poisson, id=subject,
corstr=exchangeable)

 

plot(effect(lbase*trt, b))

# Errore in effect(lbase*trt, b) : nessun metodo applicabile per
effect

 

 


[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Course***Salt Lake City** R/Splus Fundamentals and Programming Techniques

2006-12-19 Thread elvis
XLSolutions Corporation (www.xlsolutions-corp.com) is proud to
announce our Salt Lake City R/S-plus Fundamentals and
Programming
Techniques : www.xlsolutions-corp.com/Rfund.htm

*** Salt Lake City / February 15-16, 2007

Should we bring this course to your city? please let us know!

Reserve your seat now at the early bird rates! Payment due AFTER
the class

Course Description:

This two-day beginner to intermediate R/S-plus course focuses on a
broad spectrum of topics, from reading raw data to a comparison of R
and S. We will learn the essentials of data manipulation, graphical
visualization and R/S-plus programming. We will explore statistical
data analysis tools,including graphics with data sets. How to enhance
your plots, build your own packages (librairies) and connect via
ODBC,etc.
We will perform some statistical modeling and fit linear regression
models. Participants are encouraged to bring data for interactive
sessions

With the following outline:

- An Overview of R and S
- Data Manipulation and Graphics
- Using Lattice Graphics
- A Comparison of R and S-Plus
- How can R Complement SAS?
- Writing Functions
- Avoiding Loops
- Vectorization
- Statistical Modeling
- Project Management
- Techniques for Effective use of R and S
- Enhancing Plots
- Using High-level Plotting Functions
- Building and Distributing Packages (libraries)
- Connecting; ODBC, Rweb, Orca via sockets and via Rjava


Email us for group discounts.
Email Sue Turner: [EMAIL PROTECTED]
Phone: 206-686-1578
Visit us: www.xlsolutions-corp.com/training.htm
Please let us know if you and your colleagues are interested in this
classto take advantage of group discount. Register now to secure your
seat!

Interested in R/Splus Advanced course? email us.


Cheers,
Elvis Miller, PhD
Manager Training.
XLSolutions Corporation
206 686 1578
www.xlsolutions-corp.com
[EMAIL PROTECTED]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] nonparametric significance test for one sample

2006-12-19 Thread Greg Snow
If you data is truly limited to be non-negative and you are testing a
null hypothesis that the true distribution mean is 0, then the test is
fairly straight forward.  There exists only one distribution with mean 0
and all values required to be = 0 and that is a point mass of 1 at 0.
So if all of your data values are 0 then that means a p-value of 1 and
if any data values are greater than 0 (even if it is only 1 value and it
is only slightly greater than 0) then the p-value is 0.

If you want to then estimate what the true mean is for an unknown
distribution, then you may want to look at using a bootstrap estimate.

Hope this helps, 


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

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of HelponR
Sent: Tuesday, December 19, 2006 8:29 AM
To: r-help
Subject: [R] nonparametric significance test for one sample

Hello, Gurus:

I tried to test if the sample mean of a dataset is zero.

The data has 1500 numbers with a lot of zeros and some small positive
numbers. The data range on [0,1] but the distribution is unknown.
It is zero inflated anyway.

I tried to use the  Wilcoxon Signed Ranks test. But I read from this
website that it does assume the population pdf is symmetric.

http://www.cas.lancs.ac.uk/glossary_v1.1/nonparam.html#wsrt
The Wilcoxon Signed Ranks test does not require the assumption that the
population is normally distributed. In many applications, this test is
used in place of the one sample
t-testhttp://www.cas.lancs.ac.uk/glossary_v1.1/hyptest.html#1samptwhen
the normality assumption is questionable. It is a more powerful
alternative to the sign test, but does assume that the population
probability distribution is symmetric.

I wonder if wilcox.test( ) in R also assumes the symmetric pdf?

I checked the sign test too. But the sign *test* is not *testing
equality*of population 

If wilcox.test() cannot work for my data, I wonder if you could suggest
a kind of test? I already tried t-test (assume normality) but I want to
find something else.

Many thanks!

S

[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] BioC Advanced Course Jan 10th-12th (Space Still Available)

2006-12-19 Thread Seth Falcon
Hello all,

There is still space available for the upcoming BioC Advanced Course
being held in Seattle January 10th-12th.

For details and registration, please visit:
https://secure.bioconductor.org/biocadv/

Best Wishes,

+ seth

--
Seth Falcon | Computational Biology | Fred Hutchinson Cancer Research Center
http://bioconductor.org

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] fit sine?

2006-12-19 Thread Randy Zelick
Hello list,

I am making scatterplots of data that vary sinusoidally over 24 hours. 
With a bit of previous help from this list, I now can get an x-axis with 
time tics from 00:00 on the left edge to 12:00 in the middle and 00:00 on 
the right edge, i.e., just 24 hours.

Now I would like to fit a sin function to the plot. I've looked all over 
CRAN and the web in general, but have not found a method or package for 
this.

Can anyone make a suggestion?

Thanks,

=Randy=


Using R 2.4.0 on Solaris (unix).


R. Zelick   email: [EMAIL PROTECTED]
Department of Biology   voice: 503-725-3086
Portland State University   fax:   503-725-3888

mailing:
P.O. Box 751
Portland, OR 97207

shipping:
1719 SW 10th Ave, Room 246
Portland, OR 97201

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] attach and object masking

2006-12-19 Thread DEEPANKAR BASU
Hi R users!

I am new to R. When I try to attach a simple dataset using the attach() 
command, I get the following message:

 attach(data1)

The following object(s) are masked from package:base :

 write

Can someone tell me what this means? (`write' is the name of a variable in the 
dataset). And, do I need to do do something about this.

Thanks.

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] attach and object masking

2006-12-19 Thread Thomas Lumley
On Tue, 19 Dec 2006, DEEPANKAR BASU wrote:

 Hi R users!

 I am new to R. When I try to attach a simple dataset using the attach() 
 command, I get the following message:

 attach(data1)

The following object(s) are masked from package:base :

 write

 Can someone tell me what this means? (`write' is the name of a variable 
 in the dataset). And, do I need to do do something about this.


It means that 'write' is the name of a variable in the dataset. R is 
warning you that you have two things called 'write' -- your variable and a 
function in the base package.

It also means that you have missed at least three upgrades of R (the 
fourth is just out) since in version 2.3.0 and more recent you don't get 
the warning when a variable and a function have the same name, only for 
two variables or two functions.  There have been quite a lot of other 
changes since your version of R, so it would be worth upgrading.

-thomas

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] attach and object masking

2006-12-19 Thread Thomas Lumley
On Tue, 19 Dec 2006, Thomas Lumley wrote:

 It also means that you have missed at least three upgrades of R (the
 fourth is just out) since in version 2.3.0 and more recent you don't get
 the warning when a variable and a function have the same name, only for
 two variables or two functions.  There have been quite a lot of other
 changes since your version of R, so it would be worth upgrading.


I just noticed I didn't say explicitly whether you need to do anything 
else about the warning. You don't.

-thomas

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Problem with glmmADMB

2006-12-19 Thread Andrew Robinson
Hi Michael,

this error should be reported to the package maintainer, whom I assume
to be the package author, Dave Fournier.  I saw on his website:

Questions relating to the R-package should be posted to the ADMB user
forum under the topic ADMB NBMM for R

http://otter-rsch.com/admbre/examples/glmmadmb/glmmADMB.html

Cheers

Andrew

On Tue, Dec 19, 2006 at 11:04:56AM -0500, Michael Kubovy wrote:
 library(glmmADMB)
 #Example for   glmm.admb
 data(epil2)
 glmm.admb(y~Base*trt+Age 
 +Visit,random=~Visit,group=subject,data=epil2,family=nbinom)
 
 Gives:
 Error in glmm.admb(y ~ Base * trt + Age + Visit, random = ~Visit,  
 group = subject,  :
   The function maximizer failed
 
 **
 R version 2.4.1 RC (2006-12-14 r40181)
 powerpc-apple-darwin8.8.0
 
 locale:
 C
 
 attached base packages:
 [1] utils stats graphics  grDevices datasets   
 methods   base
 
 other attached packages:
 glmmADMB   JGRiplotsJavaGD rJava  MASS   lattice
  0.3  1.4-14   1.0-5   0.3-5  0.4-12  7.2-30 0.14-16
 
 _
 Professor Michael Kubovy
 University of Virginia
 Department of Psychology
 USPS: P.O.Box 400400Charlottesville, VA 22904-4400
 Parcels:Room 102Gilmer Hall
  McCormick RoadCharlottesville, VA 22903
 Office:B011+1-434-982-4729
 Lab:B019+1-434-982-4751
 Fax:+1-434-982-4766
 WWW:http://www.people.virginia.edu/~mk9y/
 
 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.

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

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] fit sine?

2006-12-19 Thread bogdan romocea
Read up on the discrete Fourier transform:
http://en.wikipedia.org/wiki/Discrete_Fourier_transform
http://en.wikipedia.org/wiki/Frequency_spectrum#Spectrum_analysis


 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of Randy Zelick
 Sent: Tuesday, December 19, 2006 2:52 PM
 To: R list server posting
 Subject: [R] fit sine?

 Hello list,

 I am making scatterplots of data that vary sinusoidally over
 24 hours.
 With a bit of previous help from this list, I now can get an
 x-axis with
 time tics from 00:00 on the left edge to 12:00 in the middle
 and 00:00 on
 the right edge, i.e., just 24 hours.

 Now I would like to fit a sin function to the plot. I've
 looked all over
 CRAN and the web in general, but have not found a method or
 package for
 this.

 Can anyone make a suggestion?

 Thanks,

 =Randy=


 Using R 2.4.0 on Solaris (unix).


 R. Zelick email: [EMAIL PROTECTED]
 Department of Biology voice: 503-725-3086
 Portland State University fax:   503-725-3888

 mailing:
 P.O. Box 751
 Portland, OR 97207

 shipping:
 1719 SW 10th Ave, Room 246
 Portland, OR 97201

 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.


__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] effect plot

2006-12-19 Thread John Fox
Dear Ambrogi,


 -Original Message-
 From: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] On Behalf Of 
 Ambrogi Federico
 Sent: Tuesday, December 19, 2006 12:03 PM
 To: r-help@stat.math.ethz.ch
 Subject: [R] effect plot
 
 Dear R users,
 
 Is there a simple way to use the effect function 
 (library(effects)) with a GEE estimated model?

Not that I'm aware. 

Sorry,
 John

 
  
 
 library(gee)
 
 library(MASS)
 
 library(effects)
 
 attach(epil)
 
  
 
 b = gee(y ~ lbase*trt + lage + V4, family=poisson, id=subject,
 corstr=exchangeable)
 
  
 
 plot(effect(lbase*trt, b))
 
 # Errore in effect(lbase*trt, b) : nessun metodo 
 applicabile per effect
 
  
 
  
 
 
   [[alternative HTML version deleted]]
 
 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide 
 http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] configure help

2006-12-19 Thread Prof Brian Ripley
This is the wrong list for ESS questions, as both the FAQ and rw-FAQ point 
out.

However, if you read ?Startup you will see that Rprofile.site is not 
necessarily read on startup (and this is why I gave a more careful answer 
to Fridolin, for his instructions are not generic).


On Tue, 19 Dec 2006, ahmad ajakh wrote:

 Hi All,

 I ma running R under windows with xemacs and ESS.
 The Rprofile.site options, somehow gets overridden by xemacs and my options
 in Rprofile.site are not taken into account while they are when I use Rgui.
 How can I specify my options if I am using xemacs? and what configuration file
 xemacs+ess use for R.
 Thanks
 AA

 - Original Message 
 From: Brian Ripley [EMAIL PROTECTED]
 To: Fridolin Wild [EMAIL PROTECTED]
 Cc: r-help@stat.math.ethz.ch
 Sent: Tuesday, December 19, 2006 7:15:11 AM
 Subject: Re: [R] configure help

 On Tue, 19 Dec 2006, Fridolin Wild wrote:


 Hello,

 as I just spent a (too long) while searching
 for a way how to persistantly switch back the help display
 routines from chm to text, here a small documentation
 how to do that with the windows version of R.

 The windows installer asks which help type
 you want to use, I wanted to test the chm
 version -- which I didn't like.

 If you after installation want to switch back,
 you have to edit

 myRdirectory\etc\Rprofile.site 

 and change the line

options(chmhelp=TRUE)

 back to

options(chmhelp=FALSE)

 It would be nice if -- in a future release -- this
 also could be changed in the GUI settings.

 But it has nothing to do with the GUI preferences: it applies to the
 command-line version of R as well.

 What about ?help did you not understand? It says

   chmhelp = getOption(chmhelp),
   ...
  chmhelp: logical (or 'NULL'). Only relevant under Windows. If 'TRUE'
   the Compiled HTML version of the help on the topic will be
   shown in a help viewer.

 so you need to set options(chmhelp=FALSE): it is up to you where you set
 it.



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

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] xaxt=n for image()

2006-12-19 Thread Prof Brian Ripley
As the footer says,

PLEASE do read the posting guide 
http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

 example(image)
 image(x, y, volcano, col = terrain.colors(100), xaxt=n)

works as is should, and we have no way to reproduce what _you_ did.

On Tue, 19 Dec 2006, javier garcia-pintado wrote:

 The argument xaxt=n for removing the x axis from a image plot does not
 work for me.
 I'm really using a function called plot.grassmeta() in library GRASS
 that is a wrapper for image(), but it seems to me that the problem is
 not in plot.grassmeta() but in image().

 If I'm right could you tell me if there is a way to remove one axis from
 a call to image()?


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

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] attach and object masking

2006-12-19 Thread Marcin Jaworski
DEEPANKAR BASU [EMAIL PROTECTED] wrote:

Hi R users!

I am new to R. When I try to attach a simple dataset using the attach()
command, I get the following message:

 attach(data1)

The following object(s) are masked from package:base :

 write

Can someone tell me what this means? (`write' is the name of a variable
in the dataset). And, do I need to do do something about this.

Hi,
I guess, you need not to do anything, unless you want to work with the 
variable 'write' from dataset you try to attach. But if you do want use
it safely (?), one way is to rename the variable from your dataset, not
to double the name from the package that is already attached (check 
out search() to know the pecking order ;) and use ?attach to interprete 
the help page for yourself). The package gdata make the renaming process
easier for me.

MJ

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] Upgrading

2006-12-19 Thread DEEPANKAR BASU
Hi!

As per Thomas' advice, I upgraded R by using update.packages() and got the 
following warning messages:

Warning messages:
1: installation of package 'lmtest' had non-zero exit status in: 
install.packages(update[, Package], instlib, contriburl = contriburl,
2: installation of package 'quadprog' had non-zero exit status in: 
install.packages(update[, Package], instlib, contriburl = contriburl,
3: installation of package 'cluster' had non-zero exit status in: 
install.packages(update[, Package], instlib, contriburl = contriburl,
4: installation of package 'tseries' had non-zero exit status in: 
install.packages(update[, Package], instlib, contriburl = contriburl,

Do I need to worry about these messages? Do I need to do something else to 
complete the upgrade process?

Another question: what is the command for renaming an existing variable?

Thanks.
Deepankar

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Replacing values

2006-12-19 Thread downunder

Hi Marc,


thanks a lot. Your hint wiht logical conditions helped me already. Problem
is I am working with SAS beside of R. In SAS the import of data and data
manipulation is not that easy, thats why I try to code the data in the right
format. So Thanks a lot for your hints. greetings lars 

-- 
View this message in context: 
http://www.nabble.com/-R--Replacing-values-tf2841687.html#a7956809
Sent from the R help mailing list archive at Nabble.com.

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Upgrading

2006-12-19 Thread Thomas Lumley
On Tue, 19 Dec 2006, DEEPANKAR BASU wrote:

 Hi!

 As per Thomas' advice, I upgraded R by using update.packages() and got 
 the following warning messages:

That was not my advice on how to upgrade. update.packages() updates the 
packages. You need to download a new version of R itself.  You will then 
need to update or reinstall the packages. The warning messages are because 
you are updating to versions of the packages that do not run on your old 
version of R.

-thomas



 Warning messages:
 1: installation of package 'lmtest' had non-zero exit status in: 
 install.packages(update[, Package], instlib, contriburl = contriburl,
 2: installation of package 'quadprog' had non-zero exit status in: 
 install.packages(update[, Package], instlib, contriburl = contriburl,
 3: installation of package 'cluster' had non-zero exit status in: 
 install.packages(update[, Package], instlib, contriburl = contriburl,
 4: installation of package 'tseries' had non-zero exit status in: 
 install.packages(update[, Package], instlib, contriburl = contriburl,

 Do I need to worry about these messages? Do I need to do something else to 
 complete the upgrade process?

 Another question: what is the command for renaming an existing variable?

 Thanks.
 Deepankar

 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
 and provide commented, minimal, self-contained, reproducible code.


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

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Replacing values

2006-12-19 Thread downunder

Hi John,

your example works also fine. Thats what I am looking for. Thanks so far.
Greetings lars



-- 
View this message in context: 
http://www.nabble.com/-R--Replacing-values-tf2841687.html#a7967398
Sent from the R help mailing list archive at Nabble.com.

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] configure help

2006-12-19 Thread ahmad ajakh
Thanks Prof. Ripley

Your point about the ESS list is well taken. I did read the initialization at 
the start of  an R session but could not figure out
why some of the options are ignored in the Rprofile.site. But I found out that 
theses options are re-defined in init.el file in .xemacs directory
which seems obvious now to me. 

Thanks again for your help.
AA.

- Original Message 
From: Prof Brian Ripley [EMAIL PROTECTED]
To: ahmad ajakh [EMAIL PROTECTED]
Cc: Fridolin Wild [EMAIL PROTECTED]; r-help@stat.math.ethz.ch
Sent: Tuesday, December 19, 2006 5:38:18 PM
Subject: Re: [R] configure help

This is the wrong list for ESS questions, as both the FAQ and rw-FAQ point 
out.

However, if you read ?Startup you will see that Rprofile.site is not 
necessarily read on startup (and this is why I gave a more careful answer 
to Fridolin, for his instructions are not generic).


On Tue, 19 Dec 2006, ahmad ajakh wrote:

 Hi All,

 I ma running R under windows with xemacs and ESS.
 The Rprofile.site options, somehow gets overridden by xemacs and my options
 in Rprofile.site are not taken into account while they are when I use Rgui.
 How can I specify my options if I am using xemacs? and what configuration file
 xemacs+ess use for R.
 Thanks
 AA

 - Original Message 
 From: Brian Ripley [EMAIL PROTECTED]
 To: Fridolin Wild [EMAIL PROTECTED]
 Cc: r-help@stat.math.ethz.ch
 Sent: Tuesday, December 19, 2006 7:15:11 AM
 Subject: Re: [R] configure help

 On Tue, 19 Dec 2006, Fridolin Wild wrote:


 Hello,

 as I just spent a (too long) while searching
 for a way how to persistantly switch back the help display
 routines from chm to text, here a small documentation
 how to do that with the windows version of R.

 The windows installer asks which help type
 you want to use, I wanted to test the chm
 version -- which I didn't like.

 If you after installation want to switch back,
 you have to edit

 myRdirectory\etc\Rprofile.site 

 and change the line

options(chmhelp=TRUE)

 back to

options(chmhelp=FALSE)

 It would be nice if -- in a future release -- this
 also could be changed in the GUI settings.

 But it has nothing to do with the GUI preferences: it applies to the
 command-line version of R as well.

 What about ?help did you not understand? It says

   chmhelp = getOption(chmhelp),
   ...
  chmhelp: logical (or 'NULL'). Only relevant under Windows. If 'TRUE'
   the Compiled HTML version of the help on the topic will be
   shown in a help viewer.

 so you need to set options(chmhelp=FALSE): it is up to you where you set
 it.



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

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] Switching labels on a factor

2006-12-19 Thread Muenchen, Robert A (Bob)
Chris,

Argh!!! I was writing a reply just now insisting that the output below
makes no sense when it finally hit me: the first line of output from the
unclass function is just the data and bears no relationship whatsoever
with the order of the m and f below it. I had gotten the idea that
it picked up on the first value and so displayed the label to match. I
don't even want to think about how much time I spent working on a
problem that was nonexistent!

Thank you very much for your help!

Bob

 unclass(mydata$gR)
[1] 2 2 2 2 1 1 1 1
attr(,levels)
[1] m f


=
Bob Muenchen (pronounced Min'-chen), Manager 
Statistical Consulting Center
U of TN Office of Information Technology
200 Stokely Management Center, Knoxville, TN 37996-0520
Voice: (865) 974-5230 
FAX: (865) 974-4810
Email: [EMAIL PROTECTED]
Web: http://oit.utk.edu/scc, 
News: http://listserv.utk.edu/archives/statnews.html
=


-Original Message-
From: Chris Andrews [mailto:[EMAIL PROTECTED] 
Sent: Monday, December 18, 2006 12:05 PM
To: Muenchen, Robert A (Bob)
Cc: r-help@stat.math.ethz.ch
Subject: Re: [R] Switching labels on a factor


Bob,

This is I think exactly what one wants to have happen.  The first four
observations are still women.  Both the labels and the underlying
integers should change.  (If you want to give all the people sex
changes, try Relevel in the Epi package.

mydata$afterthechange - Relevel(mydata$gender, list(m=f, f=m))
mydata


  workshop gender q1 q2 q3 q4 gR afterthechange
11  f  1  1  5  1  f  m
22  f  2  1  4  1  f  m
31  f  2  2  4  3  f  m
42  f  3  1 NA  3  f  m
51  m  4  5  2  4  m  f
62  m  5  4  5  5  m  f
71  m  5  3  4  4  m  f
82  m  4  5  5 NA  m  f


unclass(mydata$afterthechange)
[1] 1 1 1 1 2 2 2 2
attr(,levels)
[1] m f

Chris


Date: Fri, 15 Dec 2006 15:34:15 -0500
From: Muenchen, Robert A (Bob) [EMAIL PROTECTED]
Subject: [R] Switching labels on a factor
To: R-help@stat.math.ethz.ch
Message-ID:

[EMAIL PROTECTED]
Content-Type: text/plain;   charset=US-ASCII

Hi All,

I'm perplexed by the way the unclass function displays a factor whose
labels have been swapped with the relevel function. I realize it won't
affect any results and that the relevel did nothing useful in this
particular case. I'm just doing it to learn ways to manipulate factors.
The display of unclass leaves me feeling that the relevel had failed.

I've checked three books  searched R-help, but found no mention of this
particular issue.  

The program below demonstrates the problem. Is this a bug, or is there a
reason for it to work this way?

Thanks,
Bob

mystring-
(id,workshop,gender,q1,q2,q3,q4
 1,1,f,1,1,5,1
 2,2,f,2,1,4,1
 3,1,f,2,2,4,3
 4,2,f,3,1, ,3
 5,1,m,4,5,2,4
 6,2,m,5,4,5,5
 7,1,m,5,3,4,4
 8,2,m,4,5,5,9)
mydata-read.table(textConnection(mystring),
   header=TRUE,sep=,,row.names=id,na.strings=9)
mydata

# Create a gender Releveled variable, gR. 
# Now 1=m, 2=f
mydata$gR - relevel(mydata$gender, m)

# Print the data to show that the labels of gR match those of gender.
mydata

# Show that the underlying codes have indeed reversed.
as.numeric(mydata$gender)
as.numeric(mydata$gR)

# Unclass the two variables to see that print order 
# implies that both the codes and labels have
# flipped, cancelling each other out. For gR,
# m appears to be associated with 2, and f with 1
unclass(mydata$gender)
unclass(mydata$gR)

=
  Bob Muenchen (pronounced Min'-chen), Manager  
  Statistical Consulting Center
  U of TN Office of Information Technology
  200 Stokely Management Center, Knoxville, TN 37996-0520
  Voice: (865) 974-5230  
  FAX:   (865) 974-4810
  Email: [EMAIL PROTECTED]
  Web:   http://oit.utk.edu/scc, 
  News:  http://listserv.utk.edu/archives/statnews.html




-- 
Christopher Andrews, PhD
SUNY Buffalo, Department of Biostatistics
242 Farber Hall, [EMAIL PROTECTED], 716 829 2756

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] how to do muliple comparisons in linear mixed models

2006-12-19 Thread liu, jcheng
Hi all,
i want to compare the several main effects in a linear model. i wonder
how to do the multiple comparisons for less confident intervals.
Thanks a lot!

-- 

Sincerely yours,

Liu, jcheng

Department of Biomedical Engineering,

School of Medicine, Tsinghua University,

Beijing, 100084, China.

[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] R.matlab question

2006-12-19 Thread Aimin Yan
Does anyone know how to solve this question about R.matlab?
I am in windowsXP, my matlab is matlab 7.0.0 19920(R14)

thanks,

Aimin

  matlab - Matlab(host=localhost, port=9998)
  if (!open(matlab)) throw(Matlab server is not running: waited 30 seconds.)
Error in list(throw(Matlab server is not running: waited 30 seconds.) = 
environment,  :

[2006-12-17 22:26:03] Exception: Matlab server is not running: waited 30 
seconds.
   at throw(Exception(...))
   at throw.default(Matlab server is not running: waited 30 seconds.)
   at throw(Matlab server is not running: waited 30 seconds.)
In addition: There were 30 warnings (use warnings() to see them)
  warnings
function (...)
UseMethod(warnings)
  warnings()
Warning messages:
1: localhost:9998 cannot be opened
2: localhost:9998 cannot be opened
3: localhost:9998 cannot be opened
4: localhost:9998 cannot be opened
5: localhost:9998 cannot be opened
6: localhost:9998 cannot be opened
7: localhost:9998 cannot be opened
8: localhost:9998 cannot be opened
9: localhost:9998 cannot be opened
10: localhost:9998 cannot be opened
11: localhost:9998 cannot be opened
12: localhost:9998 cannot be opened
13: localhost:9998 cannot be opened
14: localhost:9998 cannot be opened
15: localhost:9998 cannot be opened
16: localhost:9998 cannot be opened
17: localhost:9998 cannot be opened
18: localhost:9998 cannot be opened
19: localhost:9998 cannot be opened
20: localhost:9998 cannot be opened
21: localhost:9998 cannot be opened
22: localhost:9998 cannot be opened
23: localhost:9998 cannot be opened
24: localhost:9998 cannot be opened
25: localhost:9998 cannot be opened
26: localhost:9998 cannot be opened
27: localhost:9998 cannot be opened
28: localhost:9998 cannot be opened
29: localhost:9998 cannot be opened
30: localhost:9998 cannot be opened
 

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] biocondutor installation problem

2006-12-19 Thread Kesavan Asaithambi
Hi,

 

I am trying to install Bioconductor software on our server with Red Hat
Linux Enterprise (Server) edition version 4, 32GB Ram and automatic
proxy configuration (http://www.ntu.edu.sg/proxy.pac) setting.

from http://www.bioconductor.org http://www.bioconductor.org/  website
but couldn't install.

 

I encounter the following errors highlighted in RED when I try to
download from the website.

 

 source(http://www.bioconductor.org/biocLite.R;)

Error in file(file, r, encoding = encoding) :

unable to open connection

In addition: Warning message:

unable to connect to 'www.bioconductor.org' on port 80.

 

 

I place the address http://www.bioconductor.org/getBioC.R; in my

browser (MOZILLA-LINUX SERVER) the output is below. 

 

source(http://bioconductor.org/getBioC.R;)

 

biocLite - function(pkgs, groupName=lite, ...)

{

if (missing(pkgs))

getBioC(groupName=groupName, ...)

else

getBioC(pkgs=pkgs, groupName=groupName, ...)

}

 

How do I setup the browser setting on my LINUX RH4 server?

 

 

Please guide how we can get rid of these errors.

 

 

Thanks

 

K.Asaithambi
Laboratory Executive
Nanyang Technological University
BioInformatics Research Centre (BIRC)
50 Nanyang Drive, Research Techno Plaza
XFrontiers Block, 3rd Storey
Singapore 637553

 

 


[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] call by reference

2006-12-19 Thread biter bilen
Can anyone help me about pass by reference of arguments in R functions? 

I have read about .Alias in base package however it is defunct and there is no 
replacement for it. 

Thanks in advance.

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.