[R] Wholesale and retail data analysis tasks

2008-05-05 Thread Sevana Ltd
Hello,

We are searching for information resources for wholesale and retail data 
analysis
tasks: the tasks that are relevant and demanded from statists of
wholesale and retail companies. The reason for this search for us, a
sfotware development company is simple: one wholesale
company showed interest in our product that builds associative if-then
rules based on purchase transactions, and we are redeveloping the
system in order it to be a low cost and effective solution for solving
analytical tasks for wholesale and retail.

We would be happy if we can find here partners that would like to
participate in the project providing their requirements and/or
additional information on what functionality they would like to have
in such a system and being our alpha testers in the future. We take
all costs related to system design and development and would be eager
to share final results with the people involved in the project
and also consider working out future sales channels with them.

Thank you for your time and we hope to get some feedback from the audience.

Best regards,

Endre Domiczi, CEO
Sevana Oy, http://www.sevana.fi
Email : [EMAIL PROTECTED]
GSM   : +372 53485178

__
R-help@r-project.org 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 do I write a sum of matrixes??

2008-05-05 Thread pascal vrolijk
Hello best helpers,

I am a new user and I have been struggling for hours. So finally I decide to 
ask you:
If I have a matrix P, and P.2 = P%*%P, and P.3=P.2%*%P
is there a function to calculate the power of a matrix?? if not how can i do:
for (i in 1:10)  {P.i=P^i} 
after this I need to sum them up and my problem is to combine P and i to P.i  
can anyone help me please???

Thanks and have a nice day, 

Pascal.
 

_
[[elided Hotmail spam]]

[[alternative HTML version deleted]]

__
R-help@r-project.org 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] Limitation to R Question

2008-05-05 Thread Prof Brian Ripley

On Mon, 5 May 2008, qin gao wrote:


Dear Helpers of R,

I was wondering if you can help me with a few question about the program. I
was trying create an expression file from my CEL files and I came upon an
error stating that I had not enough memory and to see help(memory.size).

From reading the help txt it seems that my max memory allocation has been

reached. I am thinking, this is also why my computer freezes sometimes when
I am running a data set that contains over 75 CEL files. Is there a way to
solve this issue?

Furthermore, my lab is thinking of purchasing new computers because our PC
are kind of old and we were thinking of upgrading to macs. However, before
we do this, I wanted to know what are the limitation to R (ie. is it just
memory or are there other issues) and even if we purchase macs with 4GB of
memory would this solve our memory problem and be able to handle large
amount of data sets.


Larger at least -- 'large' is relative, and you have't told us the current 
size of your PC(s).  See ?"Memory-limits".  Currently there is no 64-bit 
version of R available for Windows, but there is for Mac OS -- however the 
latter is new (for R 2.7.0) and hence only beginning to be field-tested 
(and we do know of a couple of problems with the 64-bit compiler used).



I would really appreciate it if someone can please help me out. I don't know
many people that uses R at UCSD so it would help to talk to someone who
knows the program.


From your description, you would do better to ask on the Bioconductor list 
-- there is a lot of software for gene expression (I guess that is what 
you meant) in Bioconductor.




Thank you so much,
Qin J. Gao

[[alternative HTML version deleted]]

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



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

__
R-help@r-project.org 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] question about se of predicted glm values

2008-05-05 Thread Berwin A Turlach
G'day Jarrett,
> tapply(y,x,mean)
a b 
 1.00 25.58 
On Mon, 5 May 2008 20:21:26 -0700
Jarrett Byrnes <[EMAIL PROTECTED]> wrote:

> Hey, all.  I had a quick question about fitting new glm values and  
> then looking at the error around them.  I'm working with a glm using
> a Gamma distribution and a log link with two types of treatments.   
> However, when I then look at the predicted values for each category,
> I find for the one that is close to 0, 

And this does not surprise you, since with your data:

> tapply(y,x,mean)
a b 
 1.00 25.58 

So wouldn't you expect one predicted value to be close to 1 instead of
zero?

> the error (using se.fit=T with predicted) actually makes it overlap
> 0.  This is not possible, as non-0 values have no meaning.
> 
> Am I missing something in the interpretation?  

Yes. :)

For GLMs, predict returns by default the predicted values on the linear
predictor scale, not on the response scale.  Negative values for the
linear predictor are, of course, possible and may have meaning.

Look closely at the pictures that you have created.  In the first one,
for x=b, the values are around 30, in the picture with the fitted value
the prediction for x=b is around 3; clearly another scale (namely the
scale of the linear predictor).

> #get predicted values and their error
> a.fit<-predict(my.glm, data.frame(x="a"), se.fit=T)
> b.fit<-predict(my.glm, data.frame(x="b"), se.fit=T)

Try: 

a.fit<-predict(my.glm, data.frame(x="a"), se.fit=T, type="response")
b.fit<-predict(my.glm, data.frame(x="b"), se.fit=T, type="response")

Hope this helps.

Best wishes,

Berwin

=== Full address =
Berwin A TurlachTel.: +65 6515 4416 (secr)
Dept of Statistics and Applied Probability+65 6515 6650 (self)
Faculty of Science  FAX : +65 6872 3919   
National University of Singapore 
6 Science Drive 2, Blk S16, Level 7  e-mail: [EMAIL PROTECTED]
Singapore 117546http://www.stat.nus.edu.sg/~statba

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


[R] question about se of predicted glm values

2008-05-05 Thread Jarrett Byrnes
Hey, all.  I had a quick question about fitting new glm values and  
then looking at the error around them.  I'm working with a glm using a  
Gamma distribution and a log link with two types of treatments.   
However, when I then look at the predicted values for each category, I  
find for the one that is close to 0, the error (using se.fit=T with  
predicted) actually makes it overlap 0.  This is not possible, as  
non-0 values have no meaning.

Am I missing something in the interpretation?  I'm sure I am.  Is  
there are better way to plot this that is accurate?  Below is some  
sample code for an example problem.  Note that the error for the value  
for category a (plotted at the end) does cross 0.

Note: this is a simple example.  The model I'm using has covariates,  
etc, but, I wanted to work out the correct method for the simple  
example so that I could take it back to my more complex model.  Thanks!

#data
x<-as.factor(c(rep("a",4),rep("b",4)))
y<-c(0.5,2,0.3,1.2,32.6,43,23.8,2.92)

#plot the raw data
plot(y ~ as.factor(x))

#fit a glm
my.glm<-glm(y ~ x, family=Gamma(link=log))

#get predicted values and their error
a.fit<-predict(my.glm, data.frame(x="a"), se.fit=T)
b.fit<-predict(my.glm, data.frame(x="b"), se.fit=T)

#visualize it and see the SE cross 0
plot(1:2,c(a.fit$fit,b.fit$fit), pch=19, ylim=c(-2,4))
segments(1:2, c(a.fit$fit-a.fit$se.fit, b.fit$fit-b.fit$se.fit),
1:2, c(a.fit$fit+a.fit$se.fit, b.fit$fit+b.fit$se.fit))
lines(0:3,rep(0,4), lty=2)


-Jarrett





Jarrett Byrnes
Population Biology Graduate Group, UC Davis
Bodega Marine Lab
707-875-1969
http://www-eve.ucdavis.edu/stachowicz/byrnes.shtml


[[alternative HTML version deleted]]

__
R-help@r-project.org 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] adding an argument to ...

2008-05-05 Thread cgenolin

Hi the list

Is it possible to add one argument to the arguments contain in ... ?

I would like to do :

f <- function(ttt,...)[
   if(... does not contain the args uuu)
   [add uuu=3 to ...]
   else[]
   g(ttt,...)
]

More precisely, my function g is a callNextMethod()

Thanks

Christophe

PS: sorry for using [ instead of accolade, I am not in my contry and I 
do not manage to get the accolade on this ¤¦²¤£$¤@ keybord...


__
R-help@r-project.org 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] merge numerous columns of unequal length

2008-05-05 Thread Henrique Dallazuanna
Try this also:

sapply(list(d1, d2, d3), "[", 1:max(sapply(list(d1, d2, d3), length)))

On Mon, May 5, 2008 at 7:46 PM, T.D.Rudolph <[EMAIL PROTECTED]>
wrote:

>
> I have numerous objects, each containing continuous data representing the
> same variable, movement rate, yet each having a different number of rows.
> e.g.
> d1<-as.matrix(rnorm(5))
> d2<-as.matrix(rnorm(3))
> d3<-as.matrix(rnorm(6))
>
> How can I merge these three columns side-by-side in order to create a
> table
> regardless of the difference in length?  I wish to analyze the output in a
> spreadsheet format.
>
> Thanks!
> Tyler
> --
> View this message in context:
> http://www.nabble.com/merge-numerous-columns-of-unequal-length-tp17071464p17071464.html
> Sent from the R help mailing list archive at Nabble.com.
>
> __
> R-help@r-project.org 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.
>



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

[[alternative HTML version deleted]]

__
R-help@r-project.org 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] genotypes simulation

2008-05-05 Thread Claire_6700

thank you. i will take a look

claire,

Neil Shephard wrote:
> 
> 
> 
> Claire_6700 wrote:
>> 
>> Hello,
>> 
>> I am having really hard time finding a good article about simulating
>> genotypes of cases and controls at a disease locus using R.
>> 
>> if you guys can point me or guide me where i can find more information,
>> it will be helpful.
>> 
>> 
> 
> The popgen() package allows the simulation of genotype data under a
> coalescent model (via the treesim() function) or Multinomial-Drichlet
> model (via the simMD() function).  These won't quite simulate case-control
> data, but can no doubt be tweaked to get two sets of data (cases and
> controls) with the desired allele frequencies, LD etc.
> 
> There is also the rmetasim() package which interfaces R with metasim.
> 
> Alternatively if your after validation of p-values derived from genotypic
> tests of association via simulation there is also the Direction Simulation
> Approach (DSA) which is implemented in R
> (http://www.mpipsykl.mpg.de/pages/english/research/mueller_downloads.htm).
> 
> There is also an R plugin for plink
> (http://pngu.mgh.harvard.edu/~purcell/plink/) which performs simulation of
> unlinked loci that are in linkage equilibrium (although you may
> specifically want to model linkage disequilibrium).
> 
> And there is an R-plugin for PBAT which is for Population Based
> Association Tests (http://people.fas.harvard.edu/~tjhoffm/pbatR.html).
> 
> For other R-genetics information you may find the task-view at
> http://cran.r-project.org/web/views/Genetics.html useful as well as
> http://rgenetics.org/
> 
> There are also a host of other non-R options available though.  Many under
> the coalescent model (including one of the first by Richard Hudson, the ms
> program) are linked from
> http://en.wikipedia.org/wiki/Coalescent_theory#Software and additional
> software for genetic analysis (including simulation in some instances)  at
> http://linkage.rockefeller.edu/soft/ .  The vast majority will simply dump
> output to text files, so its straight-forward to call them from within R
> via a system call and then read the results into R.
> 
> Neil
> 

-- 
View this message in context: 
http://www.nabble.com/genotypes-simulation-tp17065607p17071477.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org 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] Gravity (spatial interaction) models in R

2008-05-05 Thread Melanie Murphy
I was wondering if anyone has developed (or is developing) an
implementation for gravity models (spatial interaction) in R.  I
conducted several searches on the CRAN website with no luck.  Currently
I am estimating parameters via linearization.
 
Thank you in advance
 
Melanie Murphy
 

[[alternative HTML version deleted]]

__
R-help@r-project.org 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] two-sample mean difference

2008-05-05 Thread Rolf Turner


On 6/05/2008, at 11:19 AM, <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> wrote:


Dear list,

I have a time-series Y of length n which has significant auto- 
correlation at lag 1, as indicated by acf plots.
According to certain criteria, I have defined two groups of  
observations n1 and n2. The objective is to estimate the difference  
of the means between these groups and test for significance. The  
problem is how to correct for auto-correlation within the groups.
I guess one way would be to delete consecutive observations within  
the groups?

Could maybe bootstrap, without resampling, be another option?
In that case, could I use twot. permutation ( ) function of DAAG  
package? How would it be possible to obtain the SE of the difference?


It seems to me that your ideas are rather inchoate.  You need to get  
a more clearly
formulated model for the structure of the time series.  Is it  
stationary?  If not,
then autocorrelation is not directly meaningful.  If so, then the  
mean is constant,

and the means of any ``groups'' will be the same.

If your model is properly formulated, then the question of what  
software to use to

analyze the data usually answers itself.

cheers,

Rolf Turner


##
Attention:\ This e-mail message is privileged and confid...{{dropped:9}}

__
R-help@r-project.org 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] two-sample mean difference

2008-05-05 Thread dmoutopo
Dear list, 

I have a time-series Y of length n which has significant auto-correlation at 
lag 1, as indicated by acf plots. 
According to certain criteria, I have defined two groups of observations n1 and 
n2. The objective is to estimate the difference of the means between these 
groups and test for significance. The problem is how to correct for 
auto-correlation within the groups. 
I guess one way would be to delete consecutive observations within the groups?
Could maybe bootstrap, without resampling, be another option? 
In that case, could I use twot. permutation ( ) function of DAAG package? How 
would it be possible to obtain the SE of the difference? 

Thank you!

__
R-help@r-project.org 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] merge numerous columns of unequal length

2008-05-05 Thread markleeds
you can do below but there's no way of getting arounf having NAs in your 
final matrix.


d1<-as.matrix(rnorm(5))
d2<-as.matrix(rnorm(3))
d3<-as.matrix(rnorm(6))

templist <- list(d1,d2,d3)
maxnum <- max(sapply(templist,length))
print(maxnum)

temp <- lapply(templist,function(.mat) {
  if (nrow(.mat) < maxnum) {
 return(c(.mat,rep(NA,maxnum-nrow(.mat
   } else {
 return(.mat)
   }
})

finalmat <- as.matrix(do.call(cbind,temp))
print(finalmat)



On Mon, May 5, 2008 at  6:46 PM, T.D.Rudolph wrote:

I have numerous objects, each containing continuous data representing 
the
same variable, movement rate, yet each having a different number of 
rows.  e.g.

d1<-as.matrix(rnorm(5))
d2<-as.matrix(rnorm(3))
d3<-as.matrix(rnorm(6))

How can I merge these three columns side-by-side in order to create a 
table
regardless of the difference in length?  I wish to analyze the output 
in a

spreadsheet format.

Thanks!
Tyler
--
View this message in context: 
http://www.nabble.com/merge-numerous-columns-of-unequal-length-tp17071464p17071464.html

Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org 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@r-project.org 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] merge numerous columns of unequal length

2008-05-05 Thread T.D.Rudolph

I have numerous objects, each containing continuous data representing the
same variable, movement rate, yet each having a different number of rows.  
e.g.
d1<-as.matrix(rnorm(5))
d2<-as.matrix(rnorm(3))
d3<-as.matrix(rnorm(6))

How can I merge these three columns side-by-side in order to create a table
regardless of the difference in length?  I wish to analyze the output in a
spreadsheet format.

Thanks!
Tyler
-- 
View this message in context: 
http://www.nabble.com/merge-numerous-columns-of-unequal-length-tp17071464p17071464.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org 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] Limitation to R Question

2008-05-05 Thread qin gao
Dear Helpers of R,

I was wondering if you can help me with a few question about the program. I
was trying create an expression file from my CEL files and I came upon an
error stating that I had not enough memory and to see help(memory.size).
>From reading the help txt it seems that my max memory allocation has been
reached. I am thinking, this is also why my computer freezes sometimes when
I am running a data set that contains over 75 CEL files. Is there a way to
solve this issue?

Furthermore, my lab is thinking of purchasing new computers because our PC
are kind of old and we were thinking of upgrading to macs. However, before
we do this, I wanted to know what are the limitation to R (ie. is it just
memory or are there other issues) and even if we purchase macs with 4GB of
memory would this solve our memory problem and be able to handle large
amount of data sets.

I would really appreciate it if someone can please help me out. I don't know
many people that uses R at UCSD so it would help to talk to someone who
knows the program.

Thank you so much,
Qin J. Gao

[[alternative HTML version deleted]]

__
R-help@r-project.org 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] downloading packages at local disk

2008-05-05 Thread Prof Brian Ripley

On Mon, 5 May 2008, John Fox wrote:


Dear Rodrigo,

I'm going to assume from your description that you're using a Windows OS. In
that case, you can download Windows binary packages for the current version
of R from the packages' pages on CRAN (e.g.,
http://cran.r-project.org/web/packages/car/index.html for the car package --
note, BTW, lower-case car not CAR) or from
http://cran.r-project.org/bin/windows/contrib/2.7/ (or from the
corresponding locations on a CRAN mirror).  Once downloaded, you can install
from the "Packages -> Install package(s) from local zip files" menu.


And if you wanted to download 'car' in a Windows version of R, you could 
use something like


download.packages("car", "g:/Rpkgs")

to put it in folder g:/Rpkgs on your flash drive.  (For some other OS, 
set options(pkgType="win.binary") first.)



The mass and boot packages are part of the standard R distribution and don't
have to be downloaded or installed separately.


But it is MASS, and part of the VR bundle (you can't download MASS alone). 
You might want to update those, though (both had updates today).





I hope this helps,
John

--
John Fox, Professor
Department of Sociology
McMaster University
Hamilton, Ontario, Canada
web: socserv.mcmaster.ca/jfox


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]

On

Behalf Of Rodrigo Briceño
Sent: May-05-08 5:13 PM
To: r-help@r-project.org
Subject: [R] downloading packages at local disk

Hi again R users. I was reviewing the manual of R about how to install
packages using the GUI and it's corresponding menu packages. My
question is how to download a specific set of packages in order to
install them in a computer that doesn't have internet access. Is there
a web page where I can search those packages? Basically I'm trying to
copy in a flash drive the packages MASS, BOOT and CAR.

Thanks for your help.

Rodrigo Briceño

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



--
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595__
R-help@r-project.org 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] downloading packages at local disk

2008-05-05 Thread Henrique Dallazuanna
Try the download.packages function also:

download.packages(c("car", "boot", "MASS"), destdir = "C://")


On Mon, May 5, 2008 at 6:12 PM, Rodrigo Briceño <[EMAIL PROTECTED]>
wrote:

> Hi again R users. I was reviewing the manual of R about how to install
> packages using the GUI and it's corresponding menu packages. My
> question is how to download a specific set of packages in order to
> install them in a computer that doesn't have internet access. Is there
> a web page where I can search those packages? Basically I'm trying to
> copy in a flash drive the packages MASS, BOOT and CAR.
>
> Thanks for your help.
>
> Rodrigo Briceño
>
> __
> R-help@r-project.org 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.
>



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

[[alternative HTML version deleted]]

__
R-help@r-project.org 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] downloading packages at local disk

2008-05-05 Thread Jorge Ivan Velez
Dear Rodrigo,

The packages are available in http://cran.r-project.org/web/packages/ What
you can do is download them to your flash drive in .zip format. Once you do
that, you can install them from R via "Packages"->"Install package(s) from
local zip files" and browsing them in your flash drive.

To use them type

> library(MASS)
> library(boot)
> library(car)

in the R console.


HTH,

Jorge





On Mon, May 5, 2008 at 5:12 PM, Rodrigo Briceño <[EMAIL PROTECTED]>
wrote:

> Hi again R users. I was reviewing the manual of R about how to install
> packages using the GUI and it's corresponding menu packages. My
> question is how to download a specific set of packages in order to
> install them in a computer that doesn't have internet access. Is there
> a web page where I can search those packages? Basically I'm trying to
> copy in a flash drive the packages MASS, BOOT and CAR.
>
> Thanks for your help.
>
> Rodrigo Briceño
>
> __
> R-help@r-project.org 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@r-project.org 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] downloading packages at local disk

2008-05-05 Thread John Fox
Dear Rodrigo,

I'm going to assume from your description that you're using a Windows OS. In
that case, you can download Windows binary packages for the current version
of R from the packages' pages on CRAN (e.g.,
http://cran.r-project.org/web/packages/car/index.html for the car package --
note, BTW, lower-case car not CAR) or from
http://cran.r-project.org/bin/windows/contrib/2.7/ (or from the
corresponding locations on a CRAN mirror).  Once downloaded, you can install
from the "Packages -> Install package(s) from local zip files" menu.

The mass and boot packages are part of the standard R distribution and don't
have to be downloaded or installed separately.

I hope this helps,
 John

--
John Fox, Professor
Department of Sociology
McMaster University
Hamilton, Ontario, Canada
web: socserv.mcmaster.ca/jfox

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On
> Behalf Of Rodrigo Briceño
> Sent: May-05-08 5:13 PM
> To: r-help@r-project.org
> Subject: [R] downloading packages at local disk
> 
> Hi again R users. I was reviewing the manual of R about how to install
> packages using the GUI and it's corresponding menu packages. My
> question is how to download a specific set of packages in order to
> install them in a computer that doesn't have internet access. Is there
> a web page where I can search those packages? Basically I'm trying to
> copy in a flash drive the packages MASS, BOOT and CAR.
> 
> Thanks for your help.
> 
> Rodrigo Briceño
> 
> __
> R-help@r-project.org 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@r-project.org 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] downloading packages at local disk

2008-05-05 Thread Rodrigo Briceño
Hi again R users. I was reviewing the manual of R about how to install
packages using the GUI and it's corresponding menu packages. My
question is how to download a specific set of packages in order to
install them in a computer that doesn't have internet access. Is there
a web page where I can search those packages? Basically I'm trying to
copy in a flash drive the packages MASS, BOOT and CAR.

Thanks for your help.

Rodrigo Briceño

__
R-help@r-project.org 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] axis and tick widths decoupled (especially in rugs!)

2008-05-05 Thread Yasir Kaheil


Hi
This is an ad-hoc fix.. 
d<-rnorm(4)
plot(1:4,d)
g<-3;
rug((1:4),ticksize=-.03,lwd=g,side=1)
rug((1:4),ticksize=0,lwd=(g-1),side=1,col="white")

just drawing another white axis on top of the old one.. it looks ok :)

y



maiya wrote:
> 
> Hi!
> 
> (a complete newby, but will not give up easily!)
> 
> I was wondering if there is any way to decouple the axis and tick mark
> widths? As I understand they are both controlled by the lwd setting, and
> cannot be controlled independently? For example I might want to create
> major and minor ticks, which I now know how to do by superimposing two
> axes with different at settings, but what if I also wanted the major ticks
> to be thicker? or a different colour?
> You might find this nitpicking, but I am particularly concerned about
> rug(), which passes to axis(), in that I cannot get a decent thick-lined
> rug, without the horizontal line also becoming equally thick. 
> Is there any way to do this without having to resort to segments?
> 
> Tnx!
> 


-
Yasir H. Kaheil, Ph.D.
Catchment Research Facility
The University of Western Ontario 

-- 
View this message in context: 
http://www.nabble.com/axis-and-tick-widths-decoupled-%28especially-in-rugs%21%29-tp17068508p17070684.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org 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] RODBC and schemas

2008-05-05 Thread Duncan Golicher

Many thanks Albin,

Problem solved. This works fine for me now.

library(RODBC)
con<-odbcConnect("mydb")
odbcQuery(con,"SET search_path =meso, pg_catalog;")
d<-sqlFetch(con,"trees")
sqlSave(d,"trees2")

Duncan

Albin Blaschka wrote:

Duncan Golicher writes:

[snip]
thread that I found led to an obvious solution. Brian Ripley pointed 
out the issue with the dot syntax and suggested that "you can set the 
schema and then use unqualified names." Does anyone know how this can 
be done for postgresql?

[snip]

The SQL-Syntax for this is:
SET search_path = schemaname, anotherschema, pg_catalog;

So, you have to pass this to postgres beforehand...
Remark: pg_catalog is necessary, it is needed for general, built-in 
functions of postgres


Hope that helps,

Greetings, Albin





--
Dr Duncan Golicher
Conservación y Restauración de los bosques de Chiapas
Ecología y systemática terrestre
Conservación de la Biodiversidad
El Colegio de la Frontera Sur
Carretera Panamericana y Periférico Sur s/n
29290 San Cristóbal de las Casas, Chiapas
967 67 49000 ext 1310

Email:  [EMAIL PROTECTED]
Skype: duncangolicher
WebLog http://duncanjg.wordpress.com/

Using Thunderbird on Ubuntu Hardy 8.04

__
R-help@r-project.org 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] proportional test on epicalc library vs. Jerrold H. Zar.

2008-05-05 Thread Peter Dalgaard

José Ignacio Bustos Melo wrote:

Hi everyone,

I'm working with the Epical library, specicatly using the power test in
proportions. I think this test is not working like in the book:
Biostatistical Analysis (4th Edition): Jerrold H. Zar

In the example 23.25. (I attach this Pic) It's not the same answer.
Using the follow command don't give the same answer.

library(epicalc)
power.for.2p(0.75, 0.50, 50, 45, alpha = 0.05)

with this command the Power = 0.6402. But in the Book we find Power=0.72.

¿what it's the correct answer?...¿Zar or Chongsuvivatwong?

Thank guys!
  
Hmm, these formulas are all asymptotic formulas relying on an 
approximation with the normal distribution, and they will differ for 
finite n. Zar's formula appears to be closer to power.prop.test in 
standard R (if you put 47.5 subjects in both groups).


The difference seems to disappear with larger n, so I doubt that there 
is anything actually wrong with the epicalc formula, and for all I know, 
it might even be more accurate than the others.


In fact...

> pv <- replicate(1e5, {n1 <- rbinom(1,45, .75); n2 <- rbinom(1,50,.50) 
; prop.test(c(n1,n2), c(45,50))$p.value})

> sum(pv < .05)
[1] 64725

which does suggest a true power closer to .64 than to .72.

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

__
R-help@r-project.org 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] pwr package

2008-05-05 Thread Patrick Connolly
On Mon, 05-May-2008 at 03:18PM -0400, [EMAIL PROTECTED] wrote:

> Hello,
>
> I'm a new user of the R environment. I need to do some power analysis. For 
> this purpose, I installed the "pwr" package from the R window, but 
> unfortunately something went wrong. The installation of the package was 
> successful (I got a message saying so in R) but when I enter a function of 
> that package it says that the function does not exist!
>
> I appreciate your help,

My guess is that you didn't load it.  

try library(pwr)

HTH

-- 
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.   
   ___Patrick Connolly   
 {~._.~} Great minds discuss ideas
 _( Y )_Middle minds discuss events 
(:_~*~_:)Small minds discuss people  
 (_)-(_)   . Anon
  
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.

__
R-help@r-project.org 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] rpart for survival fits

2008-05-05 Thread Prof Brian Ripley

On Mon, 5 May 2008, Chang Liu wrote:



Hello Gurus:

When I plot a survival fit using rpart for the classification tree,


I don't think that is a 'classification tree': no classification is going 
on.  I will assume you called rpart() with a survival response.


for each node, there is a decimal based number above the event/total. I 
tried to see if it's the exponential ratio or logrithmics, neither seem 
to be the case. I'm wondering if anyone knows what they are.


Yes, I am sure the author knows.  But to be precise, plotting the fit does 
not output those numbers, the text() method does.  What it adds is the 
frame$yval component of the fit, the 'fitted value' according to 
?rpart.object (which is printed when you print the fit).


You really do need to read the documentation to understand what the fitted 
values are in this case.  E.g. http://www.mayo.edu/hsr/techrpt/61.pdf



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



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

__
R-help@r-project.org 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] pwr package

2008-05-05 Thread Kingsford Jones
see ?library

You need to load the package before R can access its functions.

Kingsford Jones

On Mon, May 5, 2008 at 12:18 PM,  <[EMAIL PROTECTED]> wrote:
> Hello,
>
>  I'm a new user of the R environment. I need to do some power analysis. For
> this purpose, I installed the "pwr" package from the R window, but
> unfortunately something went wrong. The installation of the package was
> successful (I got a message saying so in R) but when I enter a function of
> that package it says that the function does not exist!
>
>  I appreciate your help,
>
>  Sincerely,
>  Samar Mouchawrab
>
>  __
>  R-help@r-project.org 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@r-project.org 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] envelope line from a cloud of points

2008-05-05 Thread S Ellison
See
?chull



>>> "juli pausas" <[EMAIL PROTECTED]> 05/05/08 1:56 PM >>>
Hi,
Is there a way in R to plot an envelope line from a cloud of points
(x, y data) ? That is, a smooth line that include all points, where
the points do not follow a strait linear pattern. Could somebody
redirect me to some package or function for this? Thanks in advance.

Juli

-- 
http://www.ceam.es/pausas

__
R-help@r-project.org 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 email and any attachments are confidential. Any use...{{dropped:8}}

__
R-help@r-project.org 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] Finding non disjoint regular expressions

2008-05-05 Thread Prof Brian Ripley
For such simple expressions you can use 'beheading': remove the current 
match with substr() and run regrepr again.  That does not work for some 
regexps which depend on e.g. word boundaries, though.


Alternatively you can modify the source code.

On Mon, 5 May 2008, Schraga Schwartz wrote:


Hello,



Is there any way I can use the gregexpr functions (or a different function)
in a manner that will also return overlapping (i.e. non disjoint) regular
expressions?



For instance, when running gregexpr("AAA","AA"), I get two matches, one
at position 1 and one at position 4. I'd like to receive 4 matches at
positions 1, 2, 3 and 4.



Thanks,



Schraga Schwartz

Department of Human Molecular Genetics and Biochemistry,
Tel Aviv University Medical School,
Tel Aviv 69978, Israel.
Tel: +972-3-640 6894

email: [EMAIL PROTECTED]




[[alternative HTML version deleted]]

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



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

__
R-help@r-project.org 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] axis and tick widths decoupled (especially in rugs!)

2008-05-05 Thread Duncan Murdoch

On 5/5/2008 3:02 PM, maiya wrote:

Hi!

(a complete newby, but will not give up easily!)

I was wondering if there is any way to decouple the axis and tick mark
widths? As I understand they are both controlled by the lwd setting, and
cannot be controlled independently? For example I might want to create major
and minor ticks, which I now know how to do by superimposing two axes with
different at settings, but what if I also wanted the major ticks to be
thicker? or a different colour?
You might find this nitpicking, but I am particularly concerned about rug(),
which passes to axis(), in that I cannot get a decent thick-lined rug,
without the horizontal line also becoming equally thick. 
Is there any way to do this without having to resort to segments?


I don't think so, other than rewriting the internal axis code.

Duncan Murdoch

__
R-help@r-project.org 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] Plotting points on line graphs using xYplot in Hmisc

2008-05-05 Thread Deepayan Sarkar
On 5/5/08, John Poulsen <[EMAIL PROTECTED]> wrote:
>
>
>  Hello,
>
>  I am using xYplot to plot lines with confidence bands (see test example
> below).  I would like to add a single point with confidence bars to each
> graph (coordinates of the points below: px, py, pxlow, etc...).  I tried
> playing with panel=panel.superpose, but failed to get it to work.  Any ideas
> on how to add these points to the graphs?

If you want to add the same lines/points in all panels, you could
write a not-too-complicated custom panel function; e.g.,

with(dat,
 xYplot(Cbind(ycomb, y.up, y.low)~x1|factor(grp),
data=dat,type="l",
method="filled bands",
col.fill="light grey",
subscripts = TRUE,
panel = function(...) {
panel.xYplot(...)
panel.segments(pxlow, pylow, pxhi, pyhi)
},
scales=
list(y=list(relation="free"),
 x=list(alternating=c(1,1,1))),
ylim=list(c(0,1200),c(0,1

-Deepayan

__
R-help@r-project.org 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] rpart for survival fits

2008-05-05 Thread Chang Liu

Hello Gurus:
 
When I plot a survival fit using rpart for the classification tree, for each 
node, there is a decimal based number above the event/total. I tried to see if 
it's the exponential ratio or logrithmics, neither seem to be the case. I'm 
wondering if anyone knows what they are.
 
Thanks,
Karen
_
Find hidden words, unscramble celebrity names, or try the ultimate 
crosswor[[elided Hotmail spam]]

[[alternative HTML version deleted]]

__
R-help@r-project.org 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] pwr package

2008-05-05 Thread samar

Hello,

I'm a new user of the R environment. I need to do some power analysis.  
For this purpose, I installed the "pwr" package from the R window, but  
unfortunately something went wrong. The installation of the package  
was successful (I got a message saying so in R) but when I enter a  
function of that package it says that the function does not exist!


I appreciate your help,

Sincerely,
Samar Mouchawrab

__
R-help@r-project.org 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] bwplot

2008-05-05 Thread Deepayan Sarkar
On 5/5/08, cfinet <[EMAIL PROTECTED]> wrote:
> Hi,
>  I have 2 questions about bwplot in R :
>  1) How to change the order of my different boxes in the graph ?
>  2) How to rename the names of the differents boxes ? because I know how to
> do that with boxplot (using names) but I do not find the equivalent
> parameter in bwplot.

Both the labels and the order are derived from levels(y), where y is
the categorical variable in your boxplot. You can specify both when
you create a factor explicitly; see ?factor. (Also see
?reorder.factor, although I doubt that's what you want).

You can also change the labels in the bwplot call using xlim or ylim; e.g.,

bwplot(voice.part ~ height, data=singer, ylim = month.name[1:8])

-Deepayan

__
R-help@r-project.org 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] axis and tick widths decoupled (especially in rugs!)

2008-05-05 Thread maiya

Hi!

(a complete newby, but will not give up easily!)

I was wondering if there is any way to decouple the axis and tick mark
widths? As I understand they are both controlled by the lwd setting, and
cannot be controlled independently? For example I might want to create major
and minor ticks, which I now know how to do by superimposing two axes with
different at settings, but what if I also wanted the major ticks to be
thicker? or a different colour?
You might find this nitpicking, but I am particularly concerned about rug(),
which passes to axis(), in that I cannot get a decent thick-lined rug,
without the horizontal line also becoming equally thick. 
Is there any way to do this without having to resort to segments?

Tnx!
-- 
View this message in context: 
http://www.nabble.com/axis-and-tick-widths-decoupled-%28especially-in-rugs%21%29-tp17068508p17068508.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org 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] Column renaming

2008-05-05 Thread Gabor Grothendieck
There is a rename function in the reshape package and also one in the
memisc package.

On Mon, May 5, 2008 at 10:48 AM, Chip Barnaby <[EMAIL PROTECTED]> wrote:
> Dear all,
>
> Is there a less cumbersome way to rename a column by name (as opposed to
> index) than --
>
> names( X)[ names[ X] == "bob"]<-"sue"
>
> ?
>
> A semi-related question: how does one get the index of a column by name,
> something along the lines of col.index( X, "sue") ?
>
>
> Chip Barnaby
>
>
> -
> Chip Barnaby   [EMAIL PROTECTED]
> Vice President of Research
> Wrightsoft Corp.   781-862-8719 x118 voice
> 131 Hartwell Ave   781-861-2058 fax
> Lexington, MA 02421 www.wrightsoft.com
>
> __
> R-help@r-project.org 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@r-project.org 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] RODBC and schemas

2008-05-05 Thread Albin Blaschka

Duncan Golicher writes:

[snip]
thread that I found led to an obvious solution. Brian Ripley pointed out 
the issue with the dot syntax and suggested that "you can set the schema 
and then use unqualified names." Does anyone know how this can be done 
for postgresql?

[snip]

The SQL-Syntax for this is:
SET search_path = schemaname, anotherschema, pg_catalog;

So, you have to pass this to postgres beforehand...
Remark: pg_catalog is necessary, it is needed for general, built-in  
functions of postgres


Hope that helps,

Greetings, Albin


--
| Albin Blaschka, Mag.rer.nat.
| Etrichstrasse 26, A-5020 Salzburg, Austria
| * www.albinblaschka.info * www.thinkanimal.info *
| - It's hard to live in the mountains, hard but not hopeless!

__
R-help@r-project.org 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] proportional test on epicalc library vs. Jerrold H. Zar.

2008-05-05 Thread José Ignacio Bustos Melo
Hi everyone,

I'm working with the Epical library, specicatly using the power test in
proportions. I think this test is not working like in the book:
Biostatistical Analysis (4th Edition): Jerrold H. Zar

In the example 23.25. (I attach this Pic) It's not the same answer.
Using the follow command don't give the same answer.

library(epicalc)
power.for.2p(0.75, 0.50, 50, 45, alpha = 0.05)

with this command the Power = 0.6402. But in the Book we find Power=0.72.

¿what it's the correct answer?...¿Zar or Chongsuvivatwong?

Thank guys!



   O__   José Bustos M.
  c/ /'_ --- Master Apllied Stat Program
 (*) \(*) -- University of Concepción, Chile__
R-help@r-project.org 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] computational ontology to research questions, and statistical methods

2008-05-05 Thread hadley wickham
>  Question for the list members:  Is anybody aware of any existing
>  ontologies computational focusing on this topic?

Have you look at zelig (http://gking.harvard.edu/zelig/) ?  It unifies
a lot of statistical models within a framework that describes variable
types for input and output.

You might also try searching for "statistical expert systems" - e.g.
More Intelligent Statistical Software and Statistical Expert Systems:
Future Directions.  Gerald J. Hahn.  The American Statistician, Vol.
39, No. 1 (Feb., 1985), pp. 1-8.

Hadley


-- 
http://had.co.nz/

__
R-help@r-project.org 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] computational ontology to research questions, and statistical methods

2008-05-05 Thread Ricardo Pietrobon
our group at Duke is currently attempting to connect two data sets fed
through a web-based system, one containing research questions (i.e.,
variables positioned with certain roles) and a database of statistical
methods.  this connection is done informally in a number of R packages
and related software such as Rcmdr, R4calc, and Rkward where a
variable of a certain type is matched to a certain test.  For example,
a logistic regression model requires a dichotomous variable as its
dependent variable.  our goal is to formalize this link through a
computational ontology, which would standardize and hopefully
facilitate package and library development for R.

we have started some parallel efforts regarding both our requirements
for this ontology as well a search for existing ontologies.  So far we
couldn't find any existing ontology, which seems odd given the
widespread application such an ontology has

Question for the list members:  Is anybody aware of any existing
ontologies computational focusing on this topic?

thanks


Ricardo

__
R-help@r-project.org 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] Column renaming

2008-05-05 Thread Peter Dalgaard

Duncan Murdoch wrote:

On 5/5/2008 10:48 AM, Chip Barnaby wrote:

Dear all,

Is there a less cumbersome way to rename a column by name (as opposed 
to index) than --


names( X)[ names[ X] == "bob"]<-"sue"


I find this clearer:

X$sue <- X$bob
X$bob <- NULL


...or, essentially the same:

X <- within(X, {sue <-bob; rm(bob)})

Manipulating the names attribute should  be  more efficient, although 
not by order of magnitudes, I think.




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

__
R-help@r-project.org 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] Plotting points on line graphs using xYplot in Hmisc

2008-05-05 Thread John Poulsen



Hello,

I am using xYplot to plot lines with confidence bands (see test 
example below).  I would like to add a single point with 
confidence bars to each graph (coordinates of the points below: 
px, py, pxlow, etc...).  I tried playing with 
panel=panel.superpose, but failed to get it to work.  Any ideas on 
how to add these points to the graphs?


Thanks for your help,
John


## Test example

x1=seq(1,30,0.5)
y1=x1^2
y2=10*(x1^2)
ycomb=c(y1,y2)
y.up=ycomb+0.1*ycomb
y.low=ycomb-0.1*ycomb
grp=rep(c("Anls","Plts"),each=length(x1))
dat=as.data.frame(cbind(ycomb, y.up, y.low, 
rep(x1,2)),stringsAsFactors=F)

colnames(dat)=c("ycomb","y.up","y.low","x1")
py=c(200,2000); pylow=c(190,1900); pyhi=c(210,2100)
px=c(0,0); pxlow=c(0,0); pxhi=c(0,0)

with(dat,xYplot(Cbind(ycomb, y.up, y.low)~x1|factor(grp),
data=dat,type="l", method="filled bands", col.fill="light 
grey",

scales=list(y=list(relation="free"),x=list(alternating=c(1,1,1))),

ylim=list(c(0,1200),c(0,1)),
strip=strip.custom(factor.levels=c(expression("Anls 
km"^2),expression("Plants km"^2)


---
John Poulsen
223 Bartram Hall PO Box 118525
University of Florida
Gainesville, FL 32611-8525

__
R-help@r-project.org 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] Column renaming

2008-05-05 Thread hadley wickham
On Mon, May 5, 2008 at 10:54 AM, Chip Barnaby <[EMAIL PROTECTED]> wrote:
> Yes, someone else pointed out my typo, sorry.
>
>  My issue here is that referring to columns by index is risky.  Hard-coded
> indices will be buried in code and there will be trouble if (when) the data
> organization changes.  So I am trying to learn how to work with names, but
> the language does not seem to allow that approach without some awkwardness.
> I guess I could write some helper functions.

There's the rename function in the reshape package:

library(reshape)
X <- rename(X, c("bob" = "sue")

Hadley


-- 
http://had.co.nz/

__
R-help@r-project.org 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] Column renaming

2008-05-05 Thread hadley wickham
On Mon, May 5, 2008 at 12:08 PM, hadley wickham <[EMAIL PROTECTED]> wrote:
> On Mon, May 5, 2008 at 10:54 AM, Chip Barnaby <[EMAIL PROTECTED]> wrote:
>  > Yes, someone else pointed out my typo, sorry.
>  >
>  >  My issue here is that referring to columns by index is risky.  Hard-coded
>  > indices will be buried in code and there will be trouble if (when) the data
>  > organization changes.  So I am trying to learn how to work with names, but
>  > the language does not seem to allow that approach without some awkwardness.
>  > I guess I could write some helper functions.
>
>  There's the rename function in the reshape package:
>
>  library(reshape)
>  X <- rename(X, c("bob" = "sue")

Or if you just want the function:

rename <- function (x, replace) {
replacement <- replace[names(x)]
names(x)[!is.na(replacement)] <- replacement[!is.na(replacement)]
x
}

Hadley

-- 
http://had.co.nz/

__
R-help@r-project.org 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] Column renaming

2008-05-05 Thread Erik Iverson
I agree there.  I believe the same effect can be achieved with 
'transform'.


transform(X, sue = bob, bob = NULL)

Perhaps there are performance reasons for using the names() <- value 
approach for very large data.frames?


Duncan Murdoch wrote:

On 5/5/2008 10:48 AM, Chip Barnaby wrote:

Dear all,

Is there a less cumbersome way to rename a column by name (as opposed 
to index) than --


names( X)[ names[ X] == "bob"]<-"sue"


I find this clearer:

X$sue <- X$bob
X$bob <- NULL

Duncan Murdoch



?

A semi-related question: how does one get the index of a column by 
name, something along the lines of col.index( X, "sue") ?



Chip Barnaby


-
Chip Barnaby   [EMAIL PROTECTED]
Vice President of Research
Wrightsoft Corp.   781-862-8719 x118 voice
131 Hartwell Ave   781-861-2058 fax
Lexington, MA 02421 www.wrightsoft.com

__
R-help@r-project.org 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@r-project.org 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@r-project.org 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] genotypes simulation

2008-05-05 Thread Neil Shephard



Claire_6700 wrote:
> 
> Hello,
> 
> I am having really hard time finding a good article about simulating
> genotypes of cases and controls at a disease locus using R.
> 
> if you guys can point me or guide me where i can find more information, it
> will be helpful.
> 
> 

The popgen() package allows the simulation of genotype data under a
coalescent model (via the treesim() function) or Multinomial-Drichlet model
(via the simMD() function).  These won't quite simulate case-control data,
but can no doubt be tweaked to get two sets of data (cases and controls)
with the desired allele frequencies, LD etc.

There is also the rmetasim() package which interfaces R with metasim.

Alternatively if your after validation of p-values derived from genotypic
tests of association via simulation there is also the Direction Simulation
Approach (DSA) which is implemented in R
(http://www.mpipsykl.mpg.de/pages/english/research/mueller_downloads.htm).

There is also an R plugin for plink
(http://pngu.mgh.harvard.edu/~purcell/plink/) which performs simulation of
unlinked loci that are in linkage equilibrium (although you may specifically
want to model linkage disequilibrium).

And there is an R-plugin for PBAT which is for Population Based Association
Tests (http://people.fas.harvard.edu/~tjhoffm/pbatR.html).

For other R-genetics information you may find the task-view at
http://cran.r-project.org/web/views/Genetics.html useful as well as
http://rgenetics.org/

There are also a host of other non-R options available though.  Many under
the coalescent model (including one of the first by Richard Hudson, the ms
program) are linked from
http://en.wikipedia.org/wiki/Coalescent_theory#Software and additional
software for genetic analysis (including simulation in some instances)  at
http://linkage.rockefeller.edu/soft/ .  The vast majority will simply dump
output to text files, so its straight-forward to call them from within R via
a system call and then read the results into R.

Neil
-- 
View this message in context: 
http://www.nabble.com/genotypes-simulation-tp17065607p17066332.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org 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] Column renaming

2008-05-05 Thread Duncan Murdoch

On 5/5/2008 10:48 AM, Chip Barnaby wrote:

Dear all,

Is there a less cumbersome way to rename a column by name (as opposed 
to index) than --


names( X)[ names[ X] == "bob"]<-"sue"


I find this clearer:

X$sue <- X$bob
X$bob <- NULL

Duncan Murdoch



?

A semi-related question: how does one get the index of a column by 
name, something along the lines of col.index( X, "sue") ?



Chip Barnaby


-
Chip Barnaby   [EMAIL PROTECTED]
Vice President of Research
Wrightsoft Corp.   781-862-8719 x118 voice
131 Hartwell Ave   781-861-2058 fax
Lexington, MA 02421 www.wrightsoft.com

__
R-help@r-project.org 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@r-project.org 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] bwplot

2008-05-05 Thread Yasir Kaheil

Hi Cedric,
to change the names of different boxes, you could use levels on the
dataframe factor variable you're plotting- see this example:
library('lattice');
bwplot(voice.part ~ height, data=singer, xlab="Height (inches)")
singer.m<-singer
levels(singer.m$voice.part)<- c("a","f","g","j","k","o","y","t")
bwplot(voice.part ~ height, data=singer.m, xlab="Height (inches)")

I don't know how to change the order but I'm sure there is a way :) 

hope that helps


c2dric wrote:
> 
> Hi,
> I have 2 questions about bwplot in R :
> 1) How to change the order of my different boxes in the graph ?
> 2) How to rename the names of the differents boxes ? because I know  
> how to do that with boxplot (using names) but I do not find the  
> equivalent parameter in bwplot.
> 
> thanks,
> 
> Cédric
> __
> R-help@r-project.org 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.
> 
> 


-
Yasir H. Kaheil, Ph.D.
Catchment Research Facility
The University of Western Ontario 

-- 
View this message in context: 
http://www.nabble.com/bwplot-tp17062703p17065756.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org 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] genotypes simulation

2008-05-05 Thread Claire_6700

Hello,

I am having really hard time finding a good article about simulating
genotypes of cases and controls at a disease locus using R.

if you guys can point me or guide me where i can find more information, it
will be helpful.

thanks,
Claire
-- 
View this message in context: 
http://www.nabble.com/genotypes-simulation-tp17065607p17065607.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org 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] mboost partial contribution plots

2008-05-05 Thread Markus Loecher
Just having read the nice review article on boosting in the latest
"Statistical Science", I would love to reproduce some of the plots inside
that article, but it is not clear to me how to create the partial
contribution plots for the Poisson regression.
Does anyone have example code for this ?
(The vignette does not offer it, I think)


Thanks !
Markus

[[alternative HTML version deleted]]

__
R-help@r-project.org 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] Column renaming

2008-05-05 Thread Chip Barnaby

Yes, someone else pointed out my typo, sorry.

My issue here is that referring to columns by 
index is risky.  Hard-coded indices will be 
buried in code and there will be trouble if 
(when) the data organization changes.  So I am 
trying to learn how to work with names, but the 
language does not seem to allow that approach 
without some awkwardness.  I guess I could write some helper functions.


Chip Barnaby


At 11:47 AM 5/5/2008, Peter Dalgaard wrote:

Chip Barnaby wrote:
> Peter,
> My method seems to work, see below.  Is there some reason it might not
> work in general?  This is the tersest way I have found to rename, but
> it seems awkward, given that names( X) is repeated.
>
Nono, this technique works fine. It just wasn't what you wrote (look
closer!)

-p
> Chip Barnaby
> --
>
> > head( airquality)
>   Ozone Solar.R Wind Temp Month Day
> 141 190  7.4   67 5   1
> 236 118  8.0   72 5   2
> 312 149 12.6   74 5   3
> 418 313 11.5   62 5   4
> 5NA  NA 14.3   56 5   5
> 628  NA 14.9   66 5   6
> >
> > names( airquality)[names( airquality)=="Ozone"]<-"O3"
> > head( airquality)
>   O3 Solar.R Wind Temp Month Day
> 1 41 190  7.4   67 5   1
> 2 36 118  8.0   72 5   2
> 3 12 149 12.6   74 5   3
> 4 18 313 11.5   62 5   4
> 5 NA  NA 14.3   56 5   5
> 6 28  NA 14.9   66 5   6
> >
>
>
> At 11:19 AM 5/5/2008, Peter Dalgaard wrote:
>> Chip Barnaby wrote:
>> > Dear all,
>> >
>> > Is there a less cumbersome way to rename a column by name (as opposed
>> > to index) than --
>> >
>> > names( X)[ names[ X] == "bob"]<-"sue"
>> >
>> > ?
>> Not that I know of (notwithstanding that your code doesn't quite work as
>> it stands...). You might have thought that this would work, but it
>> obviously does not:
>>
>> > names(airquality["Ozone"]) <- "O3"
>> > head(airquality)
>>   Ozone Solar.R Wind Temp Month Day
>> 141 190  7.4   67 5   1
>> 236 118  8.0   72 5   2
>> 312 149 12.6   74 5   3
>> 418 313 11.5   62 5   4
>> 5NA  NA 14.3   56 5   5
>> 628  NA 14.9   66 5   6
>>
>> (This is probably a design decision. In the same vein,
>>
>> airquality[6] <- data.frame(foo=1:153)
>>
>> will not change the name of column 6. It might be preferable if it did,
>> from the conceptual point of view, but it is one of those things where I
>> suspect that the world comes tumbling down if you try to change the
>> behaviour...)
>>
>> >
>> > A semi-related question: how does one get the index of a column by
>> > name, something along the lines of col.index( X, "sue") ?
>> >
>> match("sue", names(X))
>>
>> --
>>O__   Peter Dalgaard Øster Farimagsgade 5, Entr.B
>>   c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K
>>  (*) \(*) -- University of Copenhagen   Denmark  Ph:  (+45) 35327918
>> ~~ - ([EMAIL PROTECTED])  FAX: (+45) 35327907
>
> -
> Chip Barnaby   [EMAIL PROTECTED]
> Vice President of Research
> Wrightsoft Corp.   781-862-8719 x118 voice
> 131 Hartwell Ave   781-861-2058 fax
> Lexington, MA 02421 www.wrightsoft.com
> -
>
>


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


-
Chip Barnaby   [EMAIL PROTECTED]
Vice President of Research
Wrightsoft Corp.   781-862-8719 x118 voice
131 Hartwell Ave   781-861-2058 fax
Lexington, MA 02421 www.wrightsoft.com
- 


__
R-help@r-project.org 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] Column renaming

2008-05-05 Thread Peter Dalgaard
Chip Barnaby wrote:
> Peter,
> My method seems to work, see below.  Is there some reason it might not
> work in general?  This is the tersest way I have found to rename, but
> it seems awkward, given that names( X) is repeated.
>
Nono, this technique works fine. It just wasn't what you wrote (look
closer!)

-p
> Chip Barnaby
> --
>
> > head( airquality)
>   Ozone Solar.R Wind Temp Month Day
> 141 190  7.4   67 5   1
> 236 118  8.0   72 5   2
> 312 149 12.6   74 5   3
> 418 313 11.5   62 5   4
> 5NA  NA 14.3   56 5   5
> 628  NA 14.9   66 5   6
> >
> > names( airquality)[names( airquality)=="Ozone"]<-"O3"
> > head( airquality)
>   O3 Solar.R Wind Temp Month Day
> 1 41 190  7.4   67 5   1
> 2 36 118  8.0   72 5   2
> 3 12 149 12.6   74 5   3
> 4 18 313 11.5   62 5   4
> 5 NA  NA 14.3   56 5   5
> 6 28  NA 14.9   66 5   6
> >
>
>
> At 11:19 AM 5/5/2008, Peter Dalgaard wrote:
>> Chip Barnaby wrote:
>> > Dear all,
>> >
>> > Is there a less cumbersome way to rename a column by name (as opposed
>> > to index) than --
>> >
>> > names( X)[ names[ X] == "bob"]<-"sue"
>> >
>> > ?
>> Not that I know of (notwithstanding that your code doesn't quite work as
>> it stands...). You might have thought that this would work, but it
>> obviously does not:
>>
>> > names(airquality["Ozone"]) <- "O3"
>> > head(airquality)
>>   Ozone Solar.R Wind Temp Month Day
>> 141 190  7.4   67 5   1
>> 236 118  8.0   72 5   2
>> 312 149 12.6   74 5   3
>> 418 313 11.5   62 5   4
>> 5NA  NA 14.3   56 5   5
>> 628  NA 14.9   66 5   6
>>
>> (This is probably a design decision. In the same vein,
>>
>> airquality[6] <- data.frame(foo=1:153)
>>
>> will not change the name of column 6. It might be preferable if it did,
>> from the conceptual point of view, but it is one of those things where I
>> suspect that the world comes tumbling down if you try to change the
>> behaviour...)
>>
>> >
>> > A semi-related question: how does one get the index of a column by
>> > name, something along the lines of col.index( X, "sue") ?
>> >
>> match("sue", names(X))
>>
>> -- 
>>O__   Peter Dalgaard Øster Farimagsgade 5, Entr.B
>>   c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K
>>  (*) \(*) -- University of Copenhagen   Denmark  Ph:  (+45) 35327918
>> ~~ - ([EMAIL PROTECTED])  FAX: (+45) 35327907
>
> -
> Chip Barnaby   [EMAIL PROTECTED]
> Vice President of Research
> Wrightsoft Corp.   781-862-8719 x118 voice
> 131 Hartwell Ave   781-861-2058 fax
> Lexington, MA 02421 www.wrightsoft.com
> -
>
>


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

__
R-help@r-project.org 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] Column renaming

2008-05-05 Thread Chip Barnaby

Peter,
My method seems to work, see below.  Is there 
some reason it might not work in general?  This 
is the tersest way I have found to rename, but it 
seems awkward, given that names( X) is repeated.


Chip Barnaby
--

> head( airquality)
  Ozone Solar.R Wind Temp Month Day
141 190  7.4   67 5   1
236 118  8.0   72 5   2
312 149 12.6   74 5   3
418 313 11.5   62 5   4
5NA  NA 14.3   56 5   5
628  NA 14.9   66 5   6
>
> names( airquality)[names( airquality)=="Ozone"]<-"O3"
> head( airquality)
  O3 Solar.R Wind Temp Month Day
1 41 190  7.4   67 5   1
2 36 118  8.0   72 5   2
3 12 149 12.6   74 5   3
4 18 313 11.5   62 5   4
5 NA  NA 14.3   56 5   5
6 28  NA 14.9   66 5   6
>


At 11:19 AM 5/5/2008, Peter Dalgaard wrote:

Chip Barnaby wrote:
> Dear all,
>
> Is there a less cumbersome way to rename a column by name (as opposed
> to index) than --
>
> names( X)[ names[ X] == "bob"]<-"sue"
>
> ?
Not that I know of (notwithstanding that your code doesn't quite work as
it stands...). You might have thought that this would work, but it
obviously does not:

> names(airquality["Ozone"]) <- "O3"
> head(airquality)
  Ozone Solar.R Wind Temp Month Day
141 190  7.4   67 5   1
236 118  8.0   72 5   2
312 149 12.6   74 5   3
418 313 11.5   62 5   4
5NA  NA 14.3   56 5   5
628  NA 14.9   66 5   6

(This is probably a design decision. In the same vein,

airquality[6] <- data.frame(foo=1:153)

will not change the name of column 6. It might be preferable if it did,
from the conceptual point of view, but it is one of those things where I
suspect that the world comes tumbling down if you try to change the
behaviour...)

>
> A semi-related question: how does one get the index of a column by
> name, something along the lines of col.index( X, "sue") ?
>
match("sue", names(X))

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


-
Chip Barnaby   [EMAIL PROTECTED]
Vice President of Research
Wrightsoft Corp.   781-862-8719 x118 voice
131 Hartwell Ave   781-861-2058 fax
Lexington, MA 02421 www.wrightsoft.com
- 


__
R-help@r-project.org 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] RODBC and schemas

2008-05-05 Thread Duncan Golicher
I have found that the "schema.table" syntax used in Postgresql (and 
Oracle) does not work directly with RODBC.


This works

library(RODBC)
con<-odbcConnect("mydb")
d<-sqlQuery(con,"select * from meso.trees")

However this does not.

d<-sqlFetch(con,"meso.trees")
Error in odbcTableExists(channel, sqtable) :
‘meso.trees’: table not found on channel

Apparently the test if (!odbcValidChannel(channel)) is returning true. 
The inclusion of any non alphanumeric character leads a table name to be 
considered invalid.


This also means that the useful sqlSave and sqlUpdate functions cannot 
be used in the usual way for tables that are not in the public schema.


This has come up several times previously e.g. 
http://finzi.psych.upenn.edu/R/Rhelp02a/archive/113715.html, but no 
thread that I found led to an obvious solution. Brian Ripley pointed out 
the issue with the dot syntax and suggested that "you can set the schema 
and then use unqualified names." Does anyone know how this can be done 
for postgresql?


Thanks for any suggestions,

Duncan

--
Dr Duncan Golicher
Conservación y Restauración de los bosques de Chiapas
Ecología y systemática terrestre
Conservación de la Biodiversidad
El Colegio de la Frontera Sur
Carretera Panamericana y Periférico Sur s/n
29290 San Cristóbal de las Casas, Chiapas
967 67 49000 ext 1310

Email:  [EMAIL PROTECTED]
Skype: duncangolicher
WebLog http://duncanjg.wordpress.com/

Using Thunderbird on Ubuntu Hardy 8.04

__
R-help@r-project.org 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] tukey biweight of vector

2008-05-05 Thread Bert Gunter
apply(matrix(int,nr=10),2,trbm)

?apply

-- Bert Gunter
Genentech Nonclinical Statistics

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of DAVID ARTETA GARCIA
Sent: Monday, May 05, 2008 8:19 AM
To: r-help@r-project.org
Subject: [R] tukey biweight of vector

Dear list,

I have a vector of readings of length 4640

length(int)
[1] 4640

I would like to calculate Tukey´s biweight using the tbrm() function  
for the first ten values, the next ten values,etc and store it in  
another vector of length 464. Can anyone help me?

Thanks in advance

David

__
R-help@r-project.org 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@r-project.org 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] tukey biweight of vector

2008-05-05 Thread DAVID ARTETA GARCIA

Dear list,

I have a vector of readings of length 4640

length(int)
[1] 4640

I would like to calculate Tukey´s biweight using the tbrm() function  
for the first ten values, the next ten values,etc and store it in  
another vector of length 464. Can anyone help me?


Thanks in advance

David

__
R-help@r-project.org 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] Column renaming

2008-05-05 Thread Peter Dalgaard
Chip Barnaby wrote:
> Dear all,
>
> Is there a less cumbersome way to rename a column by name (as opposed
> to index) than --
>
> names( X)[ names[ X] == "bob"]<-"sue"
>
> ?
Not that I know of (notwithstanding that your code doesn't quite work as
it stands...). You might have thought that this would work, but it
obviously does not:

> names(airquality["Ozone"]) <- "O3"
> head(airquality)
  Ozone Solar.R Wind Temp Month Day
141 190  7.4   67 5   1
236 118  8.0   72 5   2
312 149 12.6   74 5   3
418 313 11.5   62 5   4
5NA  NA 14.3   56 5   5
628  NA 14.9   66 5   6

(This is probably a design decision. In the same vein,

airquality[6] <- data.frame(foo=1:153)

will not change the name of column 6. It might be preferable if it did,
from the conceptual point of view, but it is one of those things where I
suspect that the world comes tumbling down if you try to change the
behaviour...)

>
> A semi-related question: how does one get the index of a column by
> name, something along the lines of col.index( X, "sue") ?
>
match("sue", names(X))

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

__
R-help@r-project.org 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] Finding non disjoint regular expressions

2008-05-05 Thread Gabor Grothendieck
Try this:

gregexpr("A(?=AA)","AA", perl = TRUE)

Read about zero width lookahead assertions at ?regex

On Mon, May 5, 2008 at 10:16 AM, Schraga Schwartz
<[EMAIL PROTECTED]> wrote:
> Hello,
>
>
>
> Is there any way I can use the gregexpr functions (or a different function)
> in a manner that will also return overlapping (i.e. non disjoint) regular
> expressions?
>
>
>
> For instance, when running gregexpr("AAA","AA"), I get two matches, one
> at position 1 and one at position 4. I'd like to receive 4 matches at
> positions 1, 2, 3 and 4.
>
>
>
> Thanks,
>
>
>
> Schraga Schwartz
>
> Department of Human Molecular Genetics and Biochemistry,
> Tel Aviv University Medical School,
> Tel Aviv 69978, Israel.
> Tel: +972-3-640 6894
>
> email: [EMAIL PROTECTED]
>
>
>
>
>[[alternative HTML version deleted]]
>
> __
> R-help@r-project.org 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@r-project.org 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] Column renaming

2008-05-05 Thread Chip Barnaby

Dear all,

Is there a less cumbersome way to rename a column by name (as opposed 
to index) than --


names( X)[ names[ X] == "bob"]<-"sue"

?

A semi-related question: how does one get the index of a column by 
name, something along the lines of col.index( X, "sue") ?



Chip Barnaby


-
Chip Barnaby   [EMAIL PROTECTED]
Vice President of Research
Wrightsoft Corp.   781-862-8719 x118 voice
131 Hartwell Ave   781-861-2058 fax
Lexington, MA 02421 www.wrightsoft.com

__
R-help@r-project.org 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] Finding non disjoint regular expressions

2008-05-05 Thread Schraga Schwartz
Hello,

 

Is there any way I can use the gregexpr functions (or a different function)
in a manner that will also return overlapping (i.e. non disjoint) regular
expressions? 

 

For instance, when running gregexpr("AAA","AA"), I get two matches, one
at position 1 and one at position 4. I'd like to receive 4 matches at
positions 1, 2, 3 and 4. 

 

Thanks,

 

Schraga Schwartz

Department of Human Molecular Genetics and Biochemistry,
Tel Aviv University Medical School,
Tel Aviv 69978, Israel.
Tel: +972-3-640 6894

email: [EMAIL PROTECTED]

 


[[alternative HTML version deleted]]

__
R-help@r-project.org 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] Problems using rfImpute

2008-05-05 Thread Birgit Lemcke

Thank you James that you saved me from a huge mistake using NA as level.
I specified now

na.strings="NA"

 $ Sex: Factor w/ 2 levels  
"0","1": 2 2 2 2 2 2 2 2 2 2 ...
$ outLatTep_like_other   : Factor w/ 2 levels  
"0","1": 2 2 2 2 2 2 2 1 2 2 ...
$ outLatTep_like_conduplicate: Factor w/ 2 levels  
"0","1": 1 1 1 1 1 1 1 2 2 1 ...


Now it looks like that

FemMal85_SexImpute<-rfImpute(Sex~.,data=FemMal85_Sex)
ntree  OOB  1  2
300:  11.93% 11.49% 12.36%

Fehler in randomForest.default(xf, y, ntree = ntree, ..., do.trace =  
ntree,  :

NA not permitted in predictors


What`s going wrong now?

Birgit




But apart from that I get now another error message using rfImpute
Am 05.05.2008 um 15:31 schrieb James Reilly:


The values NA and "NA" are different. The first is treated as  
missing; the second is not. For example,

> table(factor(c(NA,"0","1","NA","NA")))

 0  1 NA
 1  1  2

I suspect you have "NA" where you want NA, and this is causing your  
problem.


James
--
James Reilly
Department of Statistics, University of Auckland
Private Bag 92019, Auckland, New Zealand

On 6/5/08 1:04 AM, Birgit Lemcke wrote:

Hello R-user!
I am running R 2.7.0 on a Power Book (Tiger). (I am still R and  
statistics beginner)
I tried rfImpute (randomForest) and as far as I understood should  
it replace NA`s using a proximity matrix:

 > set.seed(10)
 > Subset5Imputed<-rfImpute(Sex~., data=Subset5)
ntree  OOB  1  2
300:  11.78% 12.36% 11.21%
ntree  OOB  1  2
300:  12.07% 12.64% 11.49%
ntree  OOB  1  2
300:  11.49% 11.21% 11.78%
ntree  OOB  1  2
300:  12.50% 12.93% 12.07%
ntree  OOB  1  2
300:  12.07% 12.36% 11.78%
 > str(Subset5Imputed)
'data.frame':696 obs. of  24 variables:
$ Sex: Factor w/ 2 levels "0","1": 2 2 2 2  
2 2 2 2 2 2 ...
$ InfSpath_caducuous : Factor w/ 3 levels "0","1","NA": 1  
1 1 1 1 1 1 1 1 1 ...
$ InfType_sparsely_paniculate: Factor w/ 3 levels "0","1","NA": 1  
1 1 3 1 1 1 1 1 1 ...
But there are still NA`s in the data frame. Sorry if this reason  
is only ma stupididty and thanks for answering in advance.

B.
Birgit Lemcke
Institut für Systematische Botanik
Zollikerstrasse 107
CH-8008 Zürich
Switzerland
Ph: +41 (0)44 634 8351
[EMAIL PROTECTED]
175 Jahre UZH
«staunen.erleben.begreifen. Naturwissenschaft zum Anfassen.»
MNF-Jubiläumsevent für gross und klein.
19. April 2008, 10.00 Uhr bis 02.00 Uhr
Campus Irchel, Winterthurerstrasse 190, 8057 Zürich
Weitere Informationen http://www.175jahre.uzh.ch/naturwissenschaft




Birgit Lemcke
Institut für Systematische Botanik
Zollikerstrasse 107
CH-8008 Zürich
Switzerland
Ph: +41 (0)44 634 8351
[EMAIL PROTECTED]

175 Jahre UZH
«staunen.erleben.begreifen. Naturwissenschaft zum Anfassen.»
MNF-Jubiläumsevent für gross und klein.
19. April 2008, 10.00 Uhr bis 02.00 Uhr
Campus Irchel, Winterthurerstrasse 190, 8057 Zürich
Weitere Informationen http://www.175jahre.uzh.ch/naturwissenschaft

__
R-help@r-project.org 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] bwplot

2008-05-05 Thread cfinet

Hi,
I have 2 questions about bwplot in R :
1) How to change the order of my different boxes in the graph ?
2) How to rename the names of the differents boxes ? because I know  
how to do that with boxplot (using names) but I do not find the  
equivalent parameter in bwplot.


thanks,

Cédric
__
R-help@r-project.org 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 plots two pairwise data sets into a same graph

2008-05-05 Thread David Winsemius
"Xin" <[EMAIL PROTECTED]> wrote in
news:[EMAIL PROTECTED]: 

> Dear all: 
> 
>I fitted "Observed" into a distribution as frequency. The
>predicted values are calculated as "predicted" for frequency.
>bins is "x". I plot observed, predicted against x in a graph. the
>commond is here. 
> 
> pts=barplot(observed,xlab="points",ylab="Frequency",ylim=c(0,300),xli
> m=c(2,52),axes=FALSE,border=TRUE,names.arg=x,col="white") 
> lines(spline(pts,predicted,n=300,method="natural"),type="l",lty=5) 
> 
> However, I also want to plot the corresponding distribution. Then I
> calculated "fits" for "x-fits". But I want to plot x-fits against
> fits on the same graph with the obove one. The problem is the number
> of data points are different for these two data set. This is because
> one is barplot for frequency and the other is distribution. 
> 
> Anyone has expreience on this? 

snipped "observed" and "predicted" assignment.
> 
> x-fits=c(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,

I am puzzled by the name of your third R object. My version of R will 
not allow me to assign a value to "x-fits". It parses the dash as a 
minus-sign. The usual approach is to use a period or underscore ("_") 
in variable names.

If you try the example in barplot's help page and then experiment with 
it a bit, you may see a method that can be generalized to solve your 
problems:

The example:
> require(grDevices) # for colours
> tN <- table(Ni <- stats::rpois(100, lambda=5))
> r <- barplot(tN, col=rainbow(20))
> #- type = "h" plotting *is* 'bar'plot
> lines(r, tN, type='h', col='red', lwd=2)

# Change the line type to prove that you can get a "connected" line:
lines(r, tN, col='red', lwd=2)

# Change the "x" argument to lines  (or points() )to prove that you 
# are not constrained to replicate the "x" used by barplot.

lines(r +.5, tN, col='red', lwd=4)
points(1,6)
points(1.7,6)

-- 
David Winsemius

__
R-help@r-project.org 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] kendall tau a,b,c

2008-05-05 Thread martin klein
hi,

i have 2 lists of ranks for which i'd like to compute kendall tau.
there are ties in the ranks which (to the best of my knowledge) means i
cant use tau a but rather b or c.
how does R handle that? are ties automatically detected (using
corr.test()) and is tau b/c computed instead of tau a?
also kendall does not work when values in list 1 do not occur in list 2
(and vice versa) - how does R handle that, since it still returns results?
thx a mio!

cheers
martin

perl -l -e 'print join "", reverse split //, "!nuf evah"'

__
R-help@r-project.org 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] Most probable number

2008-05-05 Thread Riccardo Rasera

Goodmorning,
I'm looking for a package that can help me to calculate the most 
probable number for a series of diluition.

Can you help me?
That you
Riccardo Rasera

---
Dott.Agr.Rasera Riccardo
Dipartimento Territorio e Sistemi Agro-Forestali
Sezione Patologia Vegetale
Agripolis - Viale dell'Università, 16 - 35020 Legnaro (PD), Italia
e-mail: [EMAIL PROTECTED]
tel +39.049.8272887
fax +39.049.8272890
--
AVVERTENZE AI SENSI DEL D.Lgs. 196/2003 Le informazioni contenute in 
questo messaggio di posta elettronica e/o nel/i file/s allegato/i sono 
da considerarsi strettamente riservate. Il loro utilizzo è consentito 
esclusivamente al destinatario del messaggio, per le finalità indicate 
nel messaggio stesso. Qualora riceviate questo messaggio senza esserne 
il destinatario, Vi preghiamo cortesemente di darcene notizia via e-mail 
e di procedere alla distruzione del messaggio stesso, cancellandolo dal 
Vostro sistema. Conservare il messaggio stesso, divulgarlo anche in 
parte, distribuirlo ad altri  soggetti, copiarlo, od utilizzarlo per 
finalità diverse, costituisce  comportamento contrario ai principi  
dettati dal D.Lgs. 196/2003.

***
This electronic mail message and its contents are intended only for the 
use of the addressed recipient and may contain information that is 
privileged, confidential and exempt form disclosure under applicable 
law.  If you are not an intended recipient, or the agent responsible for 
delivering this email to the intended recipient, you are hereby notified 
that any use, dissemination, distribution, or copying of this 
communication is strictly prohibited and may be unlawful. If you 
received this email in error, please notify the sender immediately by 
replying to this email or by telephone, and delete the email sent in error.

***
__
R-help@r-project.org 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] Character entry mismatch in the console window

2008-05-05 Thread Prof Brian Ripley
So, you are on Windows (but didn't tell us).  Those 'quotes' in your email 
are the so-called smart quotes -- only ASCII quotation marks are accepted 
by R.


The change is that R 2.7.0 is actually reading what you pasted into the 
clipboard, not some converted version (as previous versions of R did, 
although why that conversion did not send the directional quotes which are 
in CP1252 is a mystery).  You need to sort this out in your OS -- it is 
best to switch off 'smart quotes' in Word, and do a search-and-replace 
there (or use a better editor).


On Mon, 5 May 2008, Dennis Hansen wrote:


Dear R users,

I have just de-installed my old R 2.4.1 and installed R 2.7.0. I downloaded 
this version from the South African mirror, as I am currently working in 
South Africa.


When trying to paste any of my old analyses into the console (I keep them in 
word-documents), I get an error when I first try to load the data with the 
following line (example):


lap.long.dist <- 
read.table(“C:\\Ranalysis\\SouthAfrica\\Lap.oreogena\\lap.long.distance.txt”, 
header = TRUE);


I get the error:

Error: unexpected input in "lap.long.dist <- read.table(“"

Note that (at least on my screen now) the two " (quotation marks) at the end 
of the error message are different. The only way I can make it work is to 
manually go and delete and re-type all the "-characters in my command line in 
R, before pressing enter.


This, to me, suggests that R now for some reason is "mis-matched" or whatever 
you want to call it with the way my computer uses (encodes?) its characters 
in other programmes.


Not 'other programmes', just Word.

I am sure there is an easy way to correct this in some setting, but despite 
an hour's search on the net and elsewhere, I am no closer to solving the 
problem.


Thanks in advance for any advice!

Dennis

--

Dennis Hansen, PhD

Postdoctoral Scholar
Department of Biology
371 Serra Mall, Gilbert Building, Room 109
Stanford University
Stanford, CA 94305-5020
USA
---
“Everything that shouldn’t be done to an island has been done to Mauritius. 
Except, perhaps, nuclear testing” –Richard Lewis


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



--
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595__
R-help@r-project.org 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] Problems using rfImpute

2008-05-05 Thread James Reilly


The values NA and "NA" are different. The first is treated as missing; 
the second is not. For example,

> table(factor(c(NA,"0","1","NA","NA")))

 0  1 NA
 1  1  2

I suspect you have "NA" where you want NA, and this is causing your problem.

James
--
James Reilly
Department of Statistics, University of Auckland
Private Bag 92019, Auckland, New Zealand

On 6/5/08 1:04 AM, Birgit Lemcke wrote:

Hello R-user!

I am running R 2.7.0 on a Power Book (Tiger). (I am still R and 
statistics beginner)


I tried rfImpute (randomForest) and as far as I understood should it 
replace NA`s using a proximity matrix:


 > set.seed(10)
 > Subset5Imputed<-rfImpute(Sex~., data=Subset5)
ntree  OOB  1  2
300:  11.78% 12.36% 11.21%
ntree  OOB  1  2
300:  12.07% 12.64% 11.49%
ntree  OOB  1  2
300:  11.49% 11.21% 11.78%
ntree  OOB  1  2
300:  12.50% 12.93% 12.07%
ntree  OOB  1  2
300:  12.07% 12.36% 11.78%
 > str(Subset5Imputed)

'data.frame':696 obs. of  24 variables:
$ Sex: Factor w/ 2 levels "0","1": 2 2 2 2 2 2 2 
2 2 2 ...
$ InfSpath_caducuous : Factor w/ 3 levels "0","1","NA": 1 1 1 1 
1 1 1 1 1 1 ...
$ InfType_sparsely_paniculate: Factor w/ 3 levels "0","1","NA": 1 1 1 3 
1 1 1 1 1 1 ...


But there are still NA`s in the data frame. Sorry if this reason is only 
ma stupididty and thanks for answering in advance.


B.


Birgit Lemcke
Institut für Systematische Botanik
Zollikerstrasse 107
CH-8008 Zürich
Switzerland
Ph: +41 (0)44 634 8351
[EMAIL PROTECTED]

175 Jahre UZH
«staunen.erleben.begreifen. Naturwissenschaft zum Anfassen.»
MNF-Jubiläumsevent für gross und klein.
19. April 2008, 10.00 Uhr bis 02.00 Uhr
Campus Irchel, Winterthurerstrasse 190, 8057 Zürich
Weitere Informationen http://www.175jahre.uzh.ch/naturwissenschaft


__
R-help@r-project.org 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] Character entry mismatch in the console window

2008-05-05 Thread jim holtman
Since you are using WORD, you will have to turn off the "smart quotes"
since WORD is changing them as you type.  You may just want to use
something like TINN-R to store your scripts.

On Mon, May 5, 2008 at 8:49 AM, Dennis Hansen <[EMAIL PROTECTED]> wrote:
> Dear R users,
>
> I have just de-installed my old R 2.4.1 and installed R 2.7.0. I downloaded
> this version from the South African mirror, as I am currently working in
> South Africa.
>
> When trying to paste any of my old analyses into the console (I keep them in
> word-documents), I get an error when I first try to load the data with the
> following line (example):
>
> lap.long.dist <-
> read.table("C:\\Ranalysis\\SouthAfrica\\Lap.oreogena\\lap.long.distance.txt",
> header = TRUE);
>
> I get the error:
>
> Error: unexpected input in "lap.long.dist <- read.table(""
>
> Note that (at least on my screen now) the two " (quotation marks) at the end
> of the error message are different. The only way I can make it work is to
> manually go and delete and re-type all the "-characters in my command line
> in R, before pressing enter.
>
> This, to me, suggests that R now for some reason is "mis-matched" or
> whatever you want to call it with the way my computer uses (encodes?) its
> characters in other programmes.
>
> I am sure there is an easy way to correct this in some setting, but despite
> an hour's search on the net and elsewhere, I am no closer to solving the
> problem.
>
> Thanks in advance for any advice!
>
> Dennis
>
> --
>
> Dennis Hansen, PhD
>
> Postdoctoral Scholar
> Department of Biology
> 371 Serra Mall, Gilbert Building, Room 109
> Stanford University
> Stanford, CA 94305-5020
> USA
> ---
> "Everything that shouldn't be done to an island has been done to Mauritius.
> Except, perhaps, nuclear testing" –Richard Lewis
>
> __
> R-help@r-project.org 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.
>



-- 
Jim Holtman
Cincinnati, OH
+1 513 646 9390

What is the problem you are trying to solve?

__
R-help@r-project.org 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] Problems using rfImpute

2008-05-05 Thread Birgit Lemcke

Hello R-user!

I am running R 2.7.0 on a Power Book (Tiger). (I am still R and  
statistics beginner)


I tried rfImpute (randomForest) and as far as I understood should it  
replace NA`s using a proximity matrix:


> set.seed(10)
> Subset5Imputed<-rfImpute(Sex~., data=Subset5)
ntree  OOB  1  2
300:  11.78% 12.36% 11.21%
ntree  OOB  1  2
300:  12.07% 12.64% 11.49%
ntree  OOB  1  2
300:  11.49% 11.21% 11.78%
ntree  OOB  1  2
300:  12.50% 12.93% 12.07%
ntree  OOB  1  2
300:  12.07% 12.36% 11.78%
> str(Subset5Imputed)

'data.frame':   696 obs. of  24 variables:
$ Sex: Factor w/ 2 levels "0","1": 2 2 2 2 2  
2 2 2 2 2 ...
$ InfSpath_caducuous : Factor w/ 3 levels "0","1","NA": 1 1 1  
1 1 1 1 1 1 1 ...
$ InfType_sparsely_paniculate: Factor w/ 3 levels "0","1","NA": 1 1 1  
3 1 1 1 1 1 1 ...


But there are still NA`s in the data frame. Sorry if this reason is  
only ma stupididty and thanks for answering in advance.


B.


Birgit Lemcke
Institut für Systematische Botanik
Zollikerstrasse 107
CH-8008 Zürich
Switzerland
Ph: +41 (0)44 634 8351
[EMAIL PROTECTED]

175 Jahre UZH
«staunen.erleben.begreifen. Naturwissenschaft zum Anfassen.»
MNF-Jubiläumsevent für gross und klein.
19. April 2008, 10.00 Uhr bis 02.00 Uhr
Campus Irchel, Winterthurerstrasse 190, 8057 Zürich
Weitere Informationen http://www.175jahre.uzh.ch/naturwissenschaft

__
R-help@r-project.org 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] envelope line from a cloud of points

2008-05-05 Thread roger koenker

smooth is in the eye of the beholder, but you could look at the
function convex.hull in the package tripack.


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


On May 5, 2008, at 7:56 AM, juli pausas wrote:


Hi,
Is there a way in R to plot an envelope line from a cloud of points
(x, y data) ? That is, a smooth line that include all points, where
the points do not follow a strait linear pattern. Could somebody
redirect me to some package or function for this? Thanks in advance.

Juli

--
http://www.ceam.es/pausas

__
R-help@r-project.org 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@r-project.org 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] Character entry mismatch in the console window

2008-05-05 Thread Dennis Hansen

Dear R users,

I have just de-installed my old R 2.4.1 and installed R 2.7.0. I 
downloaded this version from the South African mirror, as I am currently 
working in South Africa.


When trying to paste any of my old analyses into the console (I keep 
them in word-documents), I get an error when I first try to load the 
data with the following line (example):


lap.long.dist <- 
read.table(“C:\\Ranalysis\\SouthAfrica\\Lap.oreogena\\lap.long.distance.txt”, 
header = TRUE);


I get the error:

Error: unexpected input in "lap.long.dist <- read.table(“"

Note that (at least on my screen now) the two " (quotation marks) at the 
end of the error message are different. The only way I can make it work 
is to manually go and delete and re-type all the "-characters in my 
command line in R, before pressing enter.


This, to me, suggests that R now for some reason is "mis-matched" or 
whatever you want to call it with the way my computer uses (encodes?) 
its characters in other programmes.


I am sure there is an easy way to correct this in some setting, but 
despite an hour's search on the net and elsewhere, I am no closer to 
solving the problem.


Thanks in advance for any advice!

Dennis

--

Dennis Hansen, PhD

Postdoctoral Scholar
Department of Biology
371 Serra Mall, Gilbert Building, Room 109
Stanford University
Stanford, CA 94305-5020
USA
---
“Everything that shouldn’t be done to an island has been done to Mauritius. 
Except, perhaps, nuclear testing” –Richard Lewis

__
R-help@r-project.org 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] envelope line from a cloud of points

2008-05-05 Thread juli pausas
Hi,
Is there a way in R to plot an envelope line from a cloud of points
(x, y data) ? That is, a smooth line that include all points, where
the points do not follow a strait linear pattern. Could somebody
redirect me to some package or function for this? Thanks in advance.

Juli

-- 
http://www.ceam.es/pausas

__
R-help@r-project.org 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] splitting a vector on comma

2008-05-05 Thread Henrique Dallazuanna
Try:

scan(textConnection(u), sep=",")

On Mon, May 5, 2008 at 12:59 AM, Georg Ehret <[EMAIL PROTECTED]> wrote:

> Dear R Usergroup,
> I have the following vector and I would like to split it on ",".
> How can I do this?
> > u
> [1]
>
> "160798191,160802762,160813395,160816017,160817873,160824082,160825247,160826925,160834272,160836257,"
>
> Thank you in advance!
> With my best regards, Georg.
> 
> Georg Ehret
> Baltimore
> USA
>
>[[alternative HTML version deleted]]
>
> __
> R-help@r-project.org 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.
>



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

[[alternative HTML version deleted]]

__
R-help@r-project.org 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 plots two pairwise data sets into a same graph

2008-05-05 Thread Xin
Dear all: 

   I fitted "Observed" into a distribution as frequency. The predicted values 
are calculated as "predicted" for frequency. bins is "x". I plot observed, 
predicted against x in a graph. the commond is here. 

pts=barplot(observed,xlab="points",ylab="Frequency",ylim=c(0,300),xlim=c(2,52),axes=FALSE,border=TRUE,names.arg=x,col="white")
lines(spline(pts,predicted,n=300,method="natural"),type="l",lty=5)

However, I also want to plot the corresponding distribution. Then I calculated 
"fits" for "x-fits". But I want to plot x-fits against fits on the same graph 
with the obove one. The problem is the number of data points are different for 
these two data set. This is because one is barplot for frequency and the other 
is distribution.

Anyone has expreience on this? 

Many thanks!


Xin

observed = c(139, 235, 172, 148, 105, 107, 79, 57, 49, 42, 46, 32, 21, 21, 15, 
17, 17, 12, 13, 14, 9, 5, 2, 2, 8, 3, 1, 2, 6, 4, 7, 3, 1, 0, 1, 3, 2, 2, 2, 0, 
1)
predicted=c(139.0049754, 246.8969138, 168.1220396, 131.3463461, 106.8035411, 
88.59003341, 74.36727745, 62.93036472, 53.5594173, 45.78162026, 39.265666, 
33.76844232, 29.10540287, 25.13283707, 21.73661786, 18.82471128, 16.32199011, 
14.16652343, 12.30684833, 10.69991713, 9.309522357, 8.10506821, 7.06059872, 
6.154019632, 5.366468978, 4.681803382, 4.086175589, 3.567684717, 3.116085024, 
2.722542191, 2.379428444, 2.080149676, 1.818999049, 1.59103266, 1.391963648, 
1.218071785, 1.06612614, 0.933318768, 0.817207779, 0.715668363, 0.626850614)
x=c(0,1,6, 11, 16, 21, 26, 31, 36, 41, 46, 51, 56, 61, 66, 71, 76, 81, 86, 91, 
96, 101, 106, 111, 116, 121, 126, 131, 136, 141, 146, 151, 156, 161, 166, 171, 
176, 181, 186, 191, 196)

x-fits=c(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 
20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 
40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 
60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 
80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 
100, 101, 102, 103, 104, 105, 
106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 
122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 
138, 139, 140, 141, 142, 143, 144, 
145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 
161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 
177, 178, 179, 180, 181, 182, 183, 
184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 
200)

fits=c(139.0049754, 62.40580735, 53.21947643, 47.55494589, 43.46264373, 
40.25404036, 37.6105092, 35.3596146, 33.39787351, 31.6584273, 30.09561497, 
28.67687115, 27.37814683, 26.18116622, 25.07170369, 24.03845821, 23.07229322, 
22.16570853, 21.31246426, 20.50730718, 19.74576789, 19.02400775, 18.33870169, 
17.68694733, 17.06619345, 16.47418319, 15.90890847, 15.36857298, 
14.85156196, 14.35641729, 13.88181676, 13.42655678, 12.9895378, 12.56975199, 
12.16627269, 11.77824546, 11.40488028, 11.04544489, 10.69925898, 10.36568906, 
10.04414408, 9.734071494, 9.434953795, 9.146305489, 8.867670371, 8.598619109, 
8.33874708, 8.087672439, 7.845034369, 7.610491522, 7.383720591, 7.164415033, 
6.952283898, 6.74705077, 6.548452799, 6.356239818, 6.17017353, 5.990026769, 
5.815582817, 5.646634775, 5.482984982, 5.32485, 5.170832536, 5.021976143, 
4.877709635, 4.737874271, 4.602317873, 4.47089448, 4.343464029, 4.219892056, 
4.100049417, 3.983812025, 3.871060607, 3.761680469, 3.655561285, 3.55259689, 
3.45268509, 3.355727481, 3.261629279, 3.170299159, 3.081649105, 2.995594265, 
2.912052815, 2.830945832, 2.752197171, 2.67573335, 2.601483442, 2.529378968, 
2.459353799, 2.391344064, 2.32528806, 2.261126163, 2.198800752, 2.13825613, 
2.079438448, 2.02229564, 1.966777349, 1.912834869, 
1.860421078, 1.809490386, 1.759998674, 1.711903242, 1.665162757, 1.619737205, 
1.575587846, 1.532677161, 1.490968819, 1.450427629, 1.411019502, 1.372711411, 
1.335471359, 1.299268338, 1.264072301, 1.229854123, 1.196585576, 1.164239295, 
1.13278875, 1.10220822, 1.072472763, 1.043558192, 1.015441053, 0.988098593, 
0.961508748, 0.93565011, 0.910501915, 0.886044016, 0.862256865, 0.839121494, 
0.816619499, 0.794733017, 0.773444714, 0.752737763, 0.732595833, 0.713003073, 
0.693944093, 0.675403954, 0.65736815, 0.639822599, 0.622753627, 0.606147956, 
0.589992693, 0.574275316, 0.558983664, 0.544105928, 0.529630636, 0.515546647, 
0.501843136, 0.488509592, 0.475535801, 0.462911841, 0.450628073, 0.438675132, 
0.427043919, 0.415725591, 0.404711559, 0.393993475, 0.383563226, 0.373412929, 
0.363534923, 0.353921762, 0.34456621, 0.335461235, 0.32659, 0.317975859, 
0.309582356, 0.301413212, 0.293462323, 0.285723758, 
0.278191749, 0.270860689, 0.263725127, 0.256779764, 0.250019447, 0.243439165, 
0.237034049, 0.230799361, 0.224730497, 0.218822977, 0.213072449, 0.207474676, 
0.202025541, 0.196721

[R] Ancova_non-normality of errors

2008-05-05 Thread Yvonnick NOEL

Hello Tobias,

I am not sure what your wt variable is: I suspect a 'weight'. If it is a 
nonnegative measure, then you want a positive density model, not a normal 
density in the first place. I think you should try a Gamma GLM, and look at a 
Gamma qqplot within each of your conditions. You could try the following:

M1 = glm(wt ~ pes + origin + gender + gender:pes, family=Gamma(link=identity))

M2 = glm(wt ~ pes + origin + gender + gender:pes, family=Gamma(link=log))

M3 = glm(wt ~ pes + origin + gender + gender:pes, family=Gamma(link=inverse))

and see whether one of them fit better, in terms of qqplot adjustment or 
comparative fit indicies (AIC, BIC,...).

HTH,

Yvonnick Noel, PhD
University of Brittany
France


Message: 1
Date: Sun, 04 May 2008 11:56:09 +0200
From: Tobias Erik Reiners <[EMAIL PROTECTED]>
Subject: [R] Ancova_non-normality of errors
To: r-help@r-project.org
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain;   charset=ISO-8859-1; DelSp="Yes";
format="flowed"

Hello Helpers,

I have some problems with fitting the model for my data...
-->my Literatur says (crawley testbook)=
Non-normality of errors-->I get a banana shape Q-Q plot with opening  
of banana downwards


The goal of my analysis is to work out what effect the categorial  
factors(origin, gender) on the relation between  
log(wt)~log(pes)(-->Condition, fett ressource), have.
Does the source(origin) of translocated animals have an affect on  
performance(condition)in the new area?

I have already a best fit model and it looks quite good (or not?see below).

two slopes(gender difference)and 6 intercepts(3origin levels*2gender levels)

lm(formula = log(wt) ~ log(pes) + origin + gender + gender:log(pes))


__
R-help@r-project.org 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] Formating numbers

2008-05-05 Thread Charilaos Skiadas

On May 5, 2008, at 7:03 AM, pecardoso wrote:

Maybe a very, very basic question but how can I get a vector of  
values with the specific format:

001,002,010,100

instead of:
1,2,10,100


Not perfect, but might get you started:

sprintf("%03d",c(8:10,101))

or

formatC(c(8:10,101), width=3, flag="0")

For a better solution, so as not to hard-code the width:

paddedZeros <- function(x) {
formatC(x, width=max(nchar(x)), flag="0")
}
paddedZeros(c(8:10,101))


Paulo


Haris Skiadas
Department of Mathematics and Computer Science
Hanover College

__
R-help@r-project.org 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-pkgs] batchfiles 0-4.1

2008-05-05 Thread Gabor Grothendieck
batchfiles 0.4-1 consists of a set of Windows Vista .bat and
other scripts used as front ends to R CMD ... and for other
purposes.

Whereas Version 0.4-0 of batchfiles eliminated the need to
set any paths when running R, version 0.4-1 now eliminates
the need to set any paths when building and installing R
packages.  It does this by using the registry to find R and
rtools and uses a heuristic to find MiKTeX (since MiKTeX
does not have a reliable registry key) and temporarily sets
the path to include rtools and MiKTeX.

Version 0.4-1 also includes an rtools.bat utility which will
set the paths for that session that would have otherwise had
to be set in case you want to use rtools and MiKTeX with
other programs -- this is not needed if you only want to use
R or if you only want to build and install R packages.

Also there is a new el utility (el.js) which runs the
command given as its argument in elevated mode.  e.g.
el cmd
spawns a cmd session which is elevated.

The scripts Rcmd.bat, R.bat, Rterm.bat, Rscript.bat,
#Rscript.bat, Rgui.bat, RguiStart.bat, Rjgr.bat are actually
all the same script which query the name by which it was
called to determine the appropriate action.  These scripts
are each self containd single file scripts which do not
depend on each other or on other software.  To install any
of them just copy it to any place on your PATH and it can be
immediately used.  Uninstall by deleting it.  Atlhough they
query the registry they do not set the registry (except for
Rversions.hta which calls RSetReg.exe, a program that comes
bundled with R, that in turn sets the registry.)

Version 0.4-0 of these utilities and later have only been
tested on Vista.  Version 0.3-2 and earlier have only been
tested on XP.

More information is available on the home page:
http://batchfiles.googlecode.com

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

__
R-help@r-project.org 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] Formating numbers

2008-05-05 Thread pecardoso
Maybe a very, very basic question but how can I get a vector of values with the 
specific format:
001,002,010,100
 
instead of:
1,2,10,100
 
Paulo



De: [EMAIL PROTECTED] em nome de Stephan Moratti
Enviada: seg 05-05-2008 11:43
Para: r-help@r-project.org
Assunto: Re: [R] Validating a mixed-effects model



Hi Armin,

Alternatively you could use premutation statistics. You could shuffle
your subjects between groups randomly under the Null hypothesis of no
differences between groups and each time claculating the lme model. I am
not sure, but if you do it at each time point of your repetition at each
draw, then you could remember the greates F value for your F-value
distribution. This could control the multiple comparison problem. Then
after let's say 1000 draws you have a F value distribution under the
Null hypothesis and you could determine your critical F value from that
distribution.

Hope that helps,

Stephan


Armin wrote:

Hi

I constructed a mixed-effects model from longitudinal repeated
measurements of lab values in 22 patients seperated into two groups
with the groups as fixed effect using lme. I thought about using the
jackknife procedure, i. e., removing any one subject and calculating
the fixed effect, to assess the stability of the fixed effect and
thereby validate the model. I suppose this has been done in the
following study:

http://content.nejm.org/cgi/content/full/357/19/1903
(this may be restricted access, sorry)

Is such an approach feasible?

Also in the article results are confirmed by comparing the mixed model
with a fitted least-squares regression. I understand that this can be
achieved with lmlist, but only for for models without an additional
fixed effect!?

Are there any other good approaches to validate a mixed-effects model
that will be accepted in medical peer review?


--
*Stephan Moratti, PhD/
/**/see also: http://web.mac.com/smoratti/
/*Centro de Tecnología Biomédica CBT,
Universidad Politécnica de Madrid,

en la actualidad (currently at) en el
Centro de Magnetoencefalografía Dr. Perez Modrego,
Universidad Complutense de Madrid,
Faculdad de Medicina,
Pabellón 8,
Avda. Complutense, s/n,
28040 Madrid,
Spain,

email: [EMAIL PROTECTED] 
 [EMAIL PROTECTED]
Tel.:+34 91 394 2292
Fax.:   +34 91 394 2294
*/
/*

__
R-help@r-project.org 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@r-project.org 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] Count data in random Forest

2008-05-05 Thread Birgit Lemcke

Hello R-user!

I am running R 2.7.0 on a Power Book (Tiger). (I am still R and  
statistics beginner)


I try to find the most important variables to divide my dataset as  
given in a categorical variable using randomForest.


Is randomForest() able to deal with count data?
Or is there no difference because only the ranks are used in the trees?

Thanks in advance

Birgit

Birgit Lemcke
Institut für Systematische Botanik
Zollikerstrasse 107
CH-8008 Zürich
Switzerland
Ph: +41 (0)44 634 8351
[EMAIL PROTECTED]

175 Jahre UZH
«staunen.erleben.begreifen. Naturwissenschaft zum Anfassen.»
MNF-Jubiläumsevent für gross und klein.
19. April 2008, 10.00 Uhr bis 02.00 Uhr
Campus Irchel, Winterthurerstrasse 190, 8057 Zürich
Weitere Informationen http://www.175jahre.uzh.ch/naturwissenschaft

__
R-help@r-project.org 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] Validating a mixed-effects model

2008-05-05 Thread Stephan Moratti

Hi Armin,

Alternatively you could use premutation statistics. You could shuffle 
your subjects between groups randomly under the Null hypothesis of no 
differences between groups and each time claculating the lme model. I am 
not sure, but if you do it at each time point of your repetition at each 
draw, then you could remember the greates F value for your F-value 
distribution. This could control the multiple comparison problem. Then 
after let's say 1000 draws you have a F value distribution under the 
Null hypothesis and you could determine your critical F value from that 
distribution.


Hope that helps,

Stephan


Armin wrote:

Hi

I constructed a mixed-effects model from longitudinal repeated
measurements of lab values in 22 patients seperated into two groups
with the groups as fixed effect using lme. I thought about using the
jackknife procedure, i. e., removing any one subject and calculating
the fixed effect, to assess the stability of the fixed effect and
thereby validate the model. I suppose this has been done in the
following study:

http://content.nejm.org/cgi/content/full/357/19/1903
(this may be restricted access, sorry)

Is such an approach feasible?

Also in the article results are confirmed by comparing the mixed model
with a fitted least-squares regression. I understand that this can be
achieved with lmlist, but only for for models without an additional
fixed effect!?

Are there any other good approaches to validate a mixed-effects model
that will be accepted in medical peer review?


--
*Stephan Moratti, PhD/
/**/see also: http://web.mac.com/smoratti/
/*Centro de Tecnología Biomédica CBT,
Universidad Politécnica de Madrid,

en la actualidad (currently at) en el
Centro de Magnetoencefalografía Dr. Perez Modrego,
Universidad Complutense de Madrid,
Faculdad de Medicina,
Pabellón 8,
Avda. Complutense, s/n,
28040 Madrid,
Spain,

email: [EMAIL PROTECTED] 
[EMAIL PROTECTED]
Tel.:+34 91 394 2292
Fax.:   +34 91 394 2294
*/
/*

__
R-help@r-project.org 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.