Re: [R] connexion problem getHdata (HMisc)

2005-08-10 Thread anne . piotet
Sorry about the missing info, I'm just trying to do too many things at the 
same time!
I installed R on my Windows2000 computer (no choice there) . 

> version
platform i386-pc-mingw32
arch i386 
os   mingw32 
system   i386, mingw32 
status 
major2 
minor1.1 
year 2005 
month06 
day  20 
language R 

Hmisc version: 3.0-6  ;

On my home computer (LINUX and Windows XT) with the same (latest) R and 
Hmisc version installed, I had no problem with getHdata...

Thanks 
Anne
 

 
 



Frank E Harrell Jr <[EMAIL PROTECTED]> 
09.08.2005 22:19

A
[EMAIL PROTECTED]
cc
r-help@stat.math.ethz.ch
Objet
Re: [R] connexion problem getHdata (HMisc)






[EMAIL PROTECTED] wrote:
> **
>  This email and any files transmitted with it are confidential and
> intended solely for the use of the individual or entity to whom they
> are addressed. If you have received this email in error please notify
> the system manager.
> 
> **
> 
> Hi
> 
> Just installing R and some packages in my new job; trying to download 
> dataset directly from 
> biostatistics dptm of Vanderbilt University using getHdata from Hmisc I 
> get the following:
> 
> Error in file (file, "r") : connexion openinig not possible
> Furthermore : 
> connexion to 'biostat.mc.vanderbilt.edu' impossible on port 80 
> 
> Can one get around this problem?
> 
> NOTE: I am not an administrator on the system
> 
> 
> Anne Piotet 

It is hard for me to help when you provided no code and no output from 
typing

  version

at the command prompt.  You also did not include the version of Hmisc. 
I tried a small test:

library(Hmisc)
getHdata(titanic3)

and it worked fine, using the most recent Hmisc.

Frank

> 
>  tél: 022 809 54 36 
> e-mail: [EMAIL PROTECTED] 
> 
> Office cantonal de l'assurance-invalidité (OCAI) 
> rue de Lyon 97 
> 1203 Genève GE 
> 
>[[alternative HTML version deleted]]
> 
> 
> 
> 
> 
> __
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
http://www.R-project.org/posting-guide.html


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


[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

[R] include C functions from nmath in my own C functions

2005-08-10 Thread yyan liu
Hi:
  I followed the README in src/nmath/standalone/
to make the use the command "make shared" to make the
libRmath.so file. I also add the directories containg
libRmath.so to  LD_LIBRARY_PATH by using command 
"export
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$/home/zhliu/Backup/R-2.0.1/src/nmath/standalon
e
"
However, when I try to run the following codes. 
/***/
#define MATHLIB_STANDALONE 1
#include 

int
main()
{
/* something to force the library to be included */
qnorm(0.7, 0.0, 1.0, 0, 0); 
return 0;
}
/**/

It gives me the following error message. It seems
definitions of some R functions can not be found in
the libRmath.so file. Anyone has any idea about this
problem? Thank you very much!


/usr/local/lib/libRmath.so: undefined reference to
`expm1'
/usr/local/lib/libRmath.so: undefined reference to
`log'
/usr/local/lib/libRmath.so: undefined reference to
`sqrt'
/usr/local/lib/libRmath.so: undefined reference to
`rint'
/usr/local/lib/libRmath.so: undefined reference to
`cos'
/usr/local/lib/libRmath.so: undefined reference to
`sin'
/usr/local/lib/libRmath.so: undefined reference to
`pow'
/usr/local/lib/libRmath.so: undefined reference to
`sinh'
/usr/local/lib/libRmath.so: undefined reference to
`log10'
/usr/local/lib/libRmath.so: undefined reference to
`exp'
/usr/local/lib/libRmath.so: undefined reference to
`tan'
/usr/local/lib/libRmath.so: undefined reference to
`log1p'
/usr/local/lib/libRmath.so: undefined reference to
`hypot'
collect2: ld returned 1 exit status

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] p-values

2005-08-10 Thread Spencer Graves
  pperm seems reasonable, though I have not looked at the details.

  We should be careful about terminology, however.  So-called "exact 
p-values" are generally p-values computed assuming a distribution over a 
finite set of possible outcomes assuming some constraints to make the 
outcome space finite.  For example, Fisher's exact test for a 2x2 table 
assumes the marginals are fixed.

  I don't remember the details now, but I believe there is literature 
claiming that this may not be the best thing to do when, for example, 
when it is reasonable to assume that the number in each cell is Poisson. 
  In such cases, you may lose statistical power by conditioning on the 
marginals.  I hope someone else will enlighten us both, because I'm not 
current on the literature in this area.

  The situation with "exact tests" and "exact p-values" is not nearly 
as bad as with so-called ""exact confidence intervals", which promise to 
deliver at least the indicated coverage probability.  With discrete 
distributions, it is known that 'Approximate is better than "exact' for 
interval estimation of binomial proportions', as noted in an article of 
this title by A. Agresti and B. A. Coull (1998) American Statistician, 
52:  119-126.  (For more on this particular issue, see Brown, Cai and 
Dasgupta 2003 "Interval Estimation in Exponential Families", Statistica 
Sinica 13:  19-49).

  If this does not answer your question adequately, may I suggest you 
try the posting guide.  People report having found answers to difficult 
questions in the process of preparing a question following that guide, 
and when they do post a question, they are much more likely to get a 
useful reply.

  spencer graves

Peter Ho wrote:

> Spencer,
> 
> 
> Thank you for referring me to your other email on Exact goodness-of-fit 
> test. However, I'm not entirely sure if what you mentioned is the same 
> for my case. I'm not a statistician and it would help me if you could 
> explain what you meant in a little more detail. Perhaps I need to 
> explain the problem in more detail.
> 
> I am looking for a way to calculate exaxt p-values by Monte Carlo 
> Simulation for Durbin's test. Durbin's test statistic is similar to 
> Friedman's statistic, but considers the case of Balanced Incomplete 
> block designs. I have found a function written by Felipe de Mendiburu 
> for calculating Durbin's statistic, which gives the chi-squared p-value. 
> I have also been read an article by Torsten Hothorn "On exact rank Tests 
> in R" (R News 1(1), 11–12.) and he has shown how to calculate Monte 
> Carlo p-values using pperm. In the article by Torsten Hothorn he gives:
> 
> R> pperm(W, ranks, length(x))
> 
> He compares his method to that of StatXact, which is the program Rayner 
> and Best suggested using. Is there a way to do this for example for the 
> friedman test.
> 
> A paper by Joachim Rohmel discusses "The permutation distribution for 
> the friendman test" (Computational Statistics & Data Analysis 1997, 26: 
> 83-99). This seems to be on the lines of what I need, although I am not 
> quite sure. Has anyone tried to recode his APL program for R?
> 
> I have tried a number of things, all unsucessful. Searching through 
> previous postings have not been very successful either. It seems that 
> pperm is the way to go, but I would need help from someone on this.
> 
> Any hints on how to continue would be much appreciated.
> 
> 
> Peter
> 
> 
> Spencer Graves wrote:
> 
>> Hi, Peter:
>>
>>   Please see my reply of a few minutes ago subject:  exact 
>> goodness-of-fit test.  I don't know Rayner and Best, but the same 
>> method, I think, should apply.  spencer graves
>>
>> Peter Ho wrote:
>>
>>  
>>
>>> HI R-users,
>>>
>>> I am trying to repeat an example from Rayner and Best "A contingency 
>>> table approach to nonparametric testing (Chapter 7, Ice cream example).
>>>
>>> In their book they calculate Durbin's statistic, D1, a dispersion 
>>> statistics, D2, and a residual. P-values for each statistic is 
>>> calculated from a chi-square distribution and also Monte Carlo p-values.
>>>
>>> I have found similar p-values based on the chi-square distribution by 
>>> using:
>>>
>>> > pchisq(12, df= 6, lower.tail=F)
>>> [1] 0.0619688
>>> > pchisq(5.1, df= 6, lower.tail=F)
>>> [1] 0.5310529
>>>
>>> Is there a way to calculate the equivalent Monte Carlo p-values?
>>>
>>> The values were 0.02 and 0.138 respectively.
>>>
>>> The use of the approximate chi-square probabilities for Durbin's test 
>>> are considered not good enough according to Van der Laan (The 
>>> American Statistician 1988,42,165-166).
>>>
>>>
>>> Peter
>>> 
>>> ESTG-IPVC
>>>
>>> __
>>> R-help@stat.math.ethz.ch mailing list
>>> https://stat.ethz.ch/mailman/listinfo/r-help
>>> PLEASE do read the posting guide! 
>>> http://www.R-project.org/posting-guide.html
>>>   
>>
>>
>>  
>>
> 

Re: [R] computationally singular

2005-08-10 Thread Weiwei Shi
PCA definately is worth of trying, which was my second thought. But
thanks for the help and also on the suggestion.

On 8/10/05, Kjetil Brinchmann Halvorsen <[EMAIL PROTECTED]> wrote:
> Weiwei Shi wrote:
> 
> >I think the problem might be caused two variables are very correlated.
> >Should I check the cov matrix and try to delete some?
> >But i am just not quite sure of your reply. Could you detail it with some 
> >steps?
> >
> >thanks,
> >
> >
> Why not do principal component analysis? To identify the zero variance
> linear combination(s) look at the nzero eigenvalues.  Also, it *might*
> make sense
> to calculate a " mahalanobis" distance replacing the matrix inverse with a
> pseudoinverse.
> 
> Kjetil
> 
> 
> >weiwei
> >
> >On 8/8/05, Christian Hennig <[EMAIL PROTECTED]> wrote:
> >
> >
> >>Once I had a situation where the reason was that the variables were
> >>scaled to extremely different magnitudes. 1e-25 is a *very* small number
> >>but still there is some probability that it may help to look up standard
> >>deviations and to multiply the
> >>variable with the smallest st.dev. with 1e20 or something.
> >>
> >>Best,
> >>Christian
> >>
> >>On Mon, 8 Aug 2005, Weiwei Shi wrote:
> >>
> >>
> >>
> >>>Hi,
> >>>I have a dataset which has around 138 variables and 30,000 cases. I am
> >>>trying to calculate a mahalanobis distance matrix for them and my
> >>>procedure is like this:
> >>>
> >>>Suppose my data is stored in mymatrix
> >>>
> >>>
> S<-cov(mymatrix) # this is fine
> D<-sapply(1:nrow(mymatrix), function(i) mahalanobis(mymatrix, 
> mymatrix[i,], S))
> 
> 
> >>>Error in solve.default(cov, ...) : system is computationally singular:
> >>>reciprocal condition number = 1.09501e-25
> >>>
> >>>I understand the error message but I don't know how to trace down
> >>>which variables caused this so that I can "sacrifice" them if there
> >>>are not a lot. Again, not sure if it is due to some variables and not
> >>>sure if dropping variables is a good idea either.
> >>>
> >>>Thanks for help,
> >>>
> >>>weiwei
> >>>
> >>>
> >>>--
> >>>Weiwei Shi, Ph.D
> >>>
> >>>"Did you always know?"
> >>>"No, I did not. But I believed..."
> >>>---Matrix III
> >>>
> >>>__
> >>>R-help@stat.math.ethz.ch mailing list
> >>>https://stat.ethz.ch/mailman/listinfo/r-help
> >>>PLEASE do read the posting guide! 
> >>>http://www.R-project.org/posting-guide.html
> >>>
> >>>
> >>>
> >>*** NEW ADDRESS! ***
> >>Christian Hennig
> >>University College London, Department of Statistical Science
> >>Gower St., London WC1E 6BT, phone +44 207 679 1698
> >>[EMAIL PROTECTED], www.homepages.ucl.ac.uk/~ucakche
> >>
> >>
> >>
> >
> >
> >
> >
> 
> 
> --
> 
> Kjetil Halvorsen.
> 
> Peace is the most effective weapon of mass construction.
>--  Mahdi Elmandjra
> 
> 
> 
> 
> 
> --
> Internal Virus Database is out-of-date.
> Checked by AVG Anti-Virus.
> Version: 7.0.338 / Virus Database: 267.9.7/60 - Release Date: 28/07/2005
> 
> 


-- 
Weiwei Shi, Ph.D

"Did you always know?"
"No, I did not. But I believed..."
---Matrix III

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] computationally singular

2005-08-10 Thread Kjetil Brinchmann Halvorsen
Weiwei Shi wrote:

>I think the problem might be caused two variables are very correlated.
>Should I check the cov matrix and try to delete some?
>But i am just not quite sure of your reply. Could you detail it with some 
>steps?
>
>thanks,
>  
>
Why not do principal component analysis? To identify the zero variance
linear combination(s) look at the nzero eigenvalues.  Also, it *might* 
make sense
to calculate a " mahalanobis" distance replacing the matrix inverse with a
pseudoinverse.

Kjetil


>weiwei
>
>On 8/8/05, Christian Hennig <[EMAIL PROTECTED]> wrote:
>  
>
>>Once I had a situation where the reason was that the variables were
>>scaled to extremely different magnitudes. 1e-25 is a *very* small number
>>but still there is some probability that it may help to look up standard
>>deviations and to multiply the
>>variable with the smallest st.dev. with 1e20 or something.
>>
>>Best,
>>Christian
>>
>>On Mon, 8 Aug 2005, Weiwei Shi wrote:
>>
>>
>>
>>>Hi,
>>>I have a dataset which has around 138 variables and 30,000 cases. I am
>>>trying to calculate a mahalanobis distance matrix for them and my
>>>procedure is like this:
>>>
>>>Suppose my data is stored in mymatrix
>>>  
>>>
S<-cov(mymatrix) # this is fine
D<-sapply(1:nrow(mymatrix), function(i) mahalanobis(mymatrix, mymatrix[i,], 
S))


>>>Error in solve.default(cov, ...) : system is computationally singular:
>>>reciprocal condition number = 1.09501e-25
>>>
>>>I understand the error message but I don't know how to trace down
>>>which variables caused this so that I can "sacrifice" them if there
>>>are not a lot. Again, not sure if it is due to some variables and not
>>>sure if dropping variables is a good idea either.
>>>
>>>Thanks for help,
>>>
>>>weiwei
>>>
>>>
>>>--
>>>Weiwei Shi, Ph.D
>>>
>>>"Did you always know?"
>>>"No, I did not. But I believed..."
>>>---Matrix III
>>>
>>>__
>>>R-help@stat.math.ethz.ch mailing list
>>>https://stat.ethz.ch/mailman/listinfo/r-help
>>>PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>>>
>>>  
>>>
>>*** NEW ADDRESS! ***
>>Christian Hennig
>>University College London, Department of Statistical Science
>>Gower St., London WC1E 6BT, phone +44 207 679 1698
>>[EMAIL PROTECTED], www.homepages.ucl.ac.uk/~ucakche
>>
>>
>>
>
>
>  
>


-- 

Kjetil Halvorsen.

Peace is the most effective weapon of mass construction.
   --  Mahdi Elmandjra





-- 
Internal Virus Database is out-of-date.
Checked by AVG Anti-Virus.

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] repeated - R package

2005-08-10 Thread Gabor Grothendieck
On 8/10/05, Prof Brian Ripley <[EMAIL PROTECTED]> wrote:
> On Wed, 10 Aug 2005 [EMAIL PROTECTED] wrote:
> 
> > Thompson's Manual to Accompany Agresti's book refers to a package named
> > "repeated". It's not on CRAN from what I can see. I have seen rpm's for
> > it. Where is the best place to download this package?
> 
> See the FAQ, Q5.1.5.  As to the `best' place, it is hard to say as the URI
> keeps changing: currently it seems to be
> http://popgen.unimaas.nl/~jlindsey/rcode.html.

I have found that one can generally find it from the Related
Projects page on the R site.

That is, from the R home page click on Related Projects (second last link
on the left) and from that page click on Jim Lindsey's R page.

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Question about curve fitting...

2005-08-10 Thread Gabor Grothendieck
Note that even if you decide that this distinction is applicable,
you may still wish to run a linear model prior to
nls to get the starting values.  


On 8/10/05, Dimitris Rizopoulos <[EMAIL PROTECTED]> wrote:
> I think here it's important to consider how the errors term come into
> the model. If "y = k1 * x^k2 * e" then in the log-scale you have a
> linear model; however if you assume that "y = k1 * x^k2 + e", the you
> want a nonlinear model (i.e., nls()). For instance,
> 
> x <- runif(500, 1, 3)
> y <- 1 * x^2 + rnorm(500)
> m <- nls(y ~ exp(k1 + k2 * log(x)), start = c("k1" = 1, "k2" = 2))
> c(exp(coef(m)[1]), coef(m)[2])
> 
> 
> I hope it helps.
> 
> Best,
> Dimitris
> 
> 
> Dimitris Rizopoulos
> Ph.D. Student
> Biostatistical Centre
> School of Public Health
> Catholic University of Leuven
> 
> Address: Kapucijnenvoer 35, Leuven, Belgium
> Tel: +32/16/336899
> Fax: +32/16/337015
> Web: http://www.med.kuleuven.be/biostat/
> http://www.student.kuleuven.be/~m0390867/dimitris.htm
> 
> 
> - Original Message -
> From: "Dan Bolser" <[EMAIL PROTECTED]>
> To: "S.O. Nyangoma" <[EMAIL PROTECTED]>
> Cc: "R mailing list" 
> Sent: Wednesday, August 10, 2005 4:53 PM
> Subject: Re: [R] Question about curve fitting...
> 
> 
> > On Wed, 10 Aug 2005, S.O. Nyangoma wrote:
> >
> >>I see that
> >>log(y)=log(k1)+k2*log(x)
> >>use lm?
> >
> > Thats a nice solution in this instance, but in general how do I get
> > R to
> > fit a particular function (formula) and return the parameters?
> >
> > Cheers,
> > Dan.
> >
> >>
> >>- Original Message -
> >>From: Dan Bolser <[EMAIL PROTECTED]>
> >>Date: Wednesday, August 10, 2005 11:41 am
> >>Subject: [R] Question about curve fitting...
> >>
> >>>
> >>> Meta:
> >>> This question is somewhat long and has two parts, I would be very
> >>> happyfor someone just to nudge me in the right direction with the
> >>> manual /
> >>> tutorial, as I am somewhat lost...
> >>>
> >>>
> >>> 1) How do I fit a curve of the form "y = k1 * x^k2" ?
> >>>
> >>> I want to estimate values of k1 and k2 given the x/y data I have,
> >>> and I
> >>> can't work out how to get R to calculate and return their
> >>> estimates.
> >>>
> >>>
> >>> 2) Given the value of k1 and k2 for population A, how can I test
> >>> if
> >>> population B has significantly different values of k1 and k2?
> >>>
> >>> Sorry for the basic question. I think I just need to read up on a
> >>> few
> >>> functions.
> >>>
> >>>
> >>> I have about 50 xy pairs in total if that makes a difference.
> >>>
> >>> Dan.
> >>>
> >>> __
> >>> R-help@stat.math.ethz.ch mailing list
> >>> https://stat.ethz.ch/mailman/listinfo/r-help
> >>> PLEASE do read the posting guide!
> >>> http://www.R-project.org/posting-
> >>> guide.html
> >>
> >
> > __
> > R-help@stat.math.ethz.ch mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide!
> > http://www.R-project.org/posting-guide.html
> >
> 
> __
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] date format

2005-08-10 Thread Gabor Grothendieck
Small point but since:

- the paste function will convert its arguments to character
- as.Date will give you the format requested anyways 
- minus is the logical separator here

we could modify that to:

as.Date(paste(d, 15, sep = "-"))



On 8/10/05, bogdan romocea <[EMAIL PROTECTED]> wrote:
> You need the day to convert to a date format. Assuming day=15:
> x.date <- as.Date(paste(as.character(x),"-15",sep=""),format="%Y-%m-%d")
> 
> 
> > -Original Message-
> > From: alessandro carletti [mailto:[EMAIL PROTECTED]
> > Sent: Wednesday, August 10, 2005 9:37 AM
> > To: rHELP
> > Subject: [R] date format
> >
> >
> > Hi,
> > I have a problem with a vector (x) containing dates in
> > format "-mm" (I'm working with monthly means): how
> > can I convert it in date format, so that I can plot it
> > recognising trends for my variables?
> > class(x) says: factor
> > Thanks
> > Alex
> >
> > __
> > R-help@stat.math.ethz.ch mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide!
> > http://www.R-project.org/posting-guide.html
> >
> 
> __
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] cluster analysis question

2005-08-10 Thread Antonio Olinto
Hi,

I’m using hclust to make a cluster analysis in Q mode, but I have too many
objects (observations) and it’s difficult to identify them in the plot. I’d like
to get a list with the objects ordered in the same way they appear in the 
cluster.

I have already tried order, labels and merge but I couldn’t get the result I 
want.

Thanks for any help,

Antonio Olinto



-
WebMail Bignet - O seu provedor do litoral
www.bignet.com.br

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] background colors in image()

2005-08-10 Thread array chip
Thanks for the suggestion! It works in a way that the
entire graph window is in the background color, is
there a way to only have the plotting area (i.e. the
area within the axis box in the background color, but
leave the area outside the axes to be unchanged
(white)?

Thanks!

--- Prof Brian Ripley <[EMAIL PROTECTED]> wrote:

> On Wed, 10 Aug 2005, someone needing to conceal his
> real name wrote:
> 
> > Hi, I am using image() function to plot a matrix
> which
> > has some missing valuies (NA). It looks like, by
> > default, missing values were drawn in white color,
> How
> > can I change that into a different color, say a
> gray
> > color? I tried to use bg='gray' argument with no
> luck.
> > Anyone has a suggestion?
> 
> They are not drawn in white: in fact they are not
> drawn at all, so the 
> current background (or if transparent, the canvas)
> is what you see.
> 
> > par(bg="yellow")
> > image(matrix(c(1,2,NA, 1),2, 2))
> 
> works, for example.
> 
> -- 
> Brian D. Ripley, 
> [EMAIL PROTECTED]
> Professor of Applied Statistics, 
> http://www.stats.ox.ac.uk/~ripley/
> University of Oxford, Tel:  +44 1865
> 272861 (self)
> 1 South Parks Road, +44 1865
> 272866 (PA)
> Oxford OX1 3TG, UKFax:  +44 1865
> 272595
>

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] system is exactly singular

2005-08-10 Thread rab45+
> When trying to fit a generalized linear mixed model using glmmPQL:
>
>> fit0 <- glmmPQL(ifelse(response=="A",1,0)~gender,data=set1,
> random=~1|subject,family=binomial)
> iteration 1
> Error in solve.default(pdMatrix(a, fact = TRUE)) :
> Lapack routine dgesv: system is exactly singular
>
> Could this be occuring because the paired responses for each subject are
> always the same? If this were the case, what would be the best way to
> handle this situation?
>
> I replaced the response variable with fake data that are not always the
> same for each pair and then I don't get this (or any) error message.
>
>

Sorry, I forgot that a variable like gender will be the same for both
responses.

Rick B.

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] RGUI crash when opening script in XP Home enviroment

2005-08-10 Thread Prof Brian Ripley
On Wed, 10 Aug 2005, Prof Brian Ripley wrote:

> This is not the place to report reproducible faults: please see the
> posting guide and send a complete bug report to the appropriate place.
> (Let alone three followups from Duncan Mackay!)
>
> However, as I don't know what the `open file button' is, I cannot
> reproduce it.  Is this MDI or SDI mode, and if the former is this using
> the icon on the toolbar, whose tooltip says it is `open script'?
> ^^
> What did you expect that to do?
>
> Please make clear in your report if this one or two problems, i.e. is the 
> `not closing completely' only after the error?
>
> This looks like yet another problem caused by adding the script editor, since 
> prior to that there was pager toolbar.

Yes, that was it (it had been told the pager was an editor).  Now fixed in 
R-patched and R-devel.

> On Wed, 10 Aug 2005, Knut Krueger wrote:
>
>> 
>> 
>> Knut Krueger schrieb:
>> 
>>> If  there is a helpfile open (f.e ?glm) and it is the top window, then
>>> an exception error occurs (closing RGUI)
>>> when I hit the open file button.
>>> If the helpfile is not the top window (of the RGUI) I am able to open a
>>> new script without any error.
>>> The RGUI is not closing complete there is a blank screen left which I
>>> have to close with the X Button or Taskmanager
>>> 
>>> Windows XP Home - German Version updates installed.
>>> 
>>> R-Version 2.1.0
>>> 
>>> I
>>> 
>> And it is the same problem with the 2.1.1 patched version
>> http://www.cran.r-project.org/bin/windows/base/rpatched.html
>> 
>> with regards
>> Knut Krueger
>> http://www.biostatistic.de
>> 
>> __
>> R-help@stat.math.ethz.ch mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide! 
>> http://www.R-project.org/posting-guide.html
>> 
>
> -- 
> 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
>

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

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] system is exactly singular

2005-08-10 Thread rab45+
When trying to fit a generalized linear mixed model using glmmPQL:

> fit0 <- glmmPQL(ifelse(response=="A",1,0)~gender,data=set1,
random=~1|subject,family=binomial)
iteration 1
Error in solve.default(pdMatrix(a, fact = TRUE)) :
Lapack routine dgesv: system is exactly singular

Could this be occuring because the paired responses for each subject are
always the same? If this were the case, what would be the best way to
handle this situation?

I replaced the response variable with fake data that are not always the
same for each pair and then I don't get this (or any) error message.

Rick B.

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] how to write assignment form of function

2005-08-10 Thread Heinz Tuechler
At 17:44 10.08.2005 +0100, Patrick Burns wrote:
>S Poetry may be of use to you in this.

Thank you for the hint and thank you for S Poetry. I like it, I read it,
maybe about a year ago, but I don't remember all of it and with all the
material I collected about R it's not always easy to remember where I read
what.

Heinz Tüchler
>
>
>Patrick Burns
>[EMAIL PROTECTED]
>+44 (0)20 8525 0696
>http://www.burns-stat.com
>(home of S Poetry and "A Guide for the Unwilling S User")
>
>Heinz Tuechler wrote:
>
>>Dear All,
>>
>>where can I find information about how to write an assigment form of a
>>function?
>>For curiosity I tried to write a different form of the levels()-function,
>>since the original method for factor deletes all other attributes of a
factor.
>>Of course, the simple method would be to use instead of levels(x) <-
>>newlevels, attr(x, 'levels') <- newlevels.
>>
>>I tried the following:
>>## example
>>x <- factor(c(1,1,NA,2,3,4,4,4,1,2)); y <- x
>>attr(x, 'levels') <- c('a', 'b', 'c', 'd') # does what I want
>>x
>> [1] aa bcdddab   
>>Levels: a b c d
>> 
>>'levels.simple<-' <- function (x, value) 
>> {
>>  attr(x, 'levels') <- value
>> }
>> 
>>levels.simple(y) <- c('a', 'b', 'c', 'd') # does not what I want
>>y
>>[1] "a" "b" "c" "d"
>> 
>>Thanks,
>>Heinz Tüchler
>>
>>__
>>R-help@stat.math.ethz.ch mailing list
>>https://stat.ethz.ch/mailman/listinfo/r-help
>>PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html
>>
>>
>>
>>  
>>
>
>

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Creating new columns inside a loop

2005-08-10 Thread Peter Dalgaard
"David L. Van Brunt, Ph.D." <[EMAIL PROTECTED]> writes:

> Ok, I know R isn't an optimal environment for looping (or so I've heard) but 
> I have a need to loop through columns of data and create new columns of data 
> based on calculations within rows...
> 
> I'm sure there's a help file, but I'm not sure what search terms to use to 
> find it! The problem is that these new columns need to have names that I can 
> later access... Like NewVar1, NewVar2, etc 
> 
> In php I'd call this "indirection" but I'm not sure what to call it in R so 
> that I can find instructions on how to create, name, and address the values 
> stored this way...
> 
> any gentle nudges in the right direction would be greatly appreciated!

A little more information about what you're actually trying to do and
I'm sure someone will give you a nudge with a sledgehammer...

At present, your description is just that little bit too nebulous.

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

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Creating new columns inside a loop

2005-08-10 Thread David L. Van Brunt, Ph.D.
Ok, I know R isn't an optimal environment for looping (or so I've heard) but 
I have a need to loop through columns of data and create new columns of data 
based on calculations within rows...

I'm sure there's a help file, but I'm not sure what search terms to use to 
find it! The problem is that these new columns need to have names that I can 
later access... Like NewVar1, NewVar2, etc 

In php I'd call this "indirection" but I'm not sure what to call it in R so 
that I can find instructions on how to create, name, and address the values 
stored this way...

any gentle nudges in the right direction would be greatly appreciated!

-- 
---
David L. Van Brunt, Ph.D.
mailto:[EMAIL PROTECTED]

[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] coxph with cluster() model selection

2005-08-10 Thread Richard Chandler
Hello,

Can someone suggest a strategy of selecting a parsimonious coxph model
when there is a cluster() term, a frailty() term and several
potentially important covariates? I have read in the R-help archives
that AIC can not be used when cluster() is.  

My full model looks something like:

fit <- coxph(Surv(start, stop, fate) ~ x1 + x2 + x3 + x4 +
cluster(site) + frailty(year), data)

Thank you.

Richard


-- 
Richard Chandler
Department of Natural Resources Conservation
UMass Amherst
(413)545-1237

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] repeated - R package

2005-08-10 Thread Prof Brian Ripley
On Wed, 10 Aug 2005 [EMAIL PROTECTED] wrote:

> Thompson's Manual to Accompany Agresti's book refers to a package named
> "repeated". It's not on CRAN from what I can see. I have seen rpm's for
> it. Where is the best place to download this package?

See the FAQ, Q5.1.5.  As to the `best' place, it is hard to say as the URI 
keeps changing: currently it seems to be 
http://popgen.unimaas.nl/~jlindsey/rcode.html.

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

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] repeated - R package

2005-08-10 Thread rab45+
Thompson's Manual to Accompany Agresti's book refers to a package named
"repeated". It's not on CRAN from what I can see. I have seen rpm's for
it. Where is the best place to download this package?

Rick B.

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] background colors in image()

2005-08-10 Thread Prof Brian Ripley
On Wed, 10 Aug 2005, someone needing to conceal his real name wrote:

> Hi, I am using image() function to plot a matrix which
> has some missing valuies (NA). It looks like, by
> default, missing values were drawn in white color, How
> can I change that into a different color, say a gray
> color? I tried to use bg='gray' argument with no luck.
> Anyone has a suggestion?

They are not drawn in white: in fact they are not drawn at all, so the 
current background (or if transparent, the canvas) is what you see.

> par(bg="yellow")
> image(matrix(c(1,2,NA, 1),2, 2))

works, for example.

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

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] background colors in image()

2005-08-10 Thread array chip
Hi, I am using image() function to plot a matrix which
has some missing valuies (NA). It looks like, by
default, missing values were drawn in white color, How
can I change that into a different color, say a gray
color? I tried to use bg='gray' argument with no luck.
Anyone has a suggestion?

Thanks

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Why only a "" string for heading for row.names with write.csv with a matrix?

2005-08-10 Thread Tony Plate
Here's a relatively easy way to get what I think you want.  Note that 
converting x to a data frame before cbind'ing allows the type of the 
elements of x to be preserved:

 > x <- matrix(1:6, 2,3)
 > rownames(x) <- c("ID1", "ID2")
 > colnames(x) <- c("Attr1", "Attr2", "Attr3")
 > x
 Attr1 Attr2 Attr3
ID1 1 3 5
ID2 2 4 6
 > write.table(cbind(id=row.names(x), as.data.frame(x)), 
row.names=FALSE, sep=",")
"id","Attr1","Attr2","Attr3"
"ID1",1,3,5
"ID2",2,4,6
 >

As to why you can't get this via an argument to write.table (or 
write.csv), I suspect that part of the answer is a wish to avoid 
"creeping featuritis".  Transferring data between programs is 
notoriously infuriating.  There are more data formats than there are 
programs, but few programs use the same format as their default & 
preferred format.  So to accommodate everyone's preferred format would 
require an extremely large number of features in the data import/export 
functions.  Maintaining software that contains a large number of 
features is difficult -- it's easy for errors to creep in because there 
are so many combinations of how different features can be used on 
different functions.

The alternative to having lots of features on each function is to have a 
relatively small set of powerful functions that can be used to construct 
the behavior you want.  This type of software is thought by many to be 
easier to maintain and extend.  I think is is pretty much the preferred 
approach in R.  The above one-liner for writing the data in the form you 
want is really not much more complex than using an additional argument 
to write.table().  (And if you need to do this kind of thing frequently, 
then it's easy in R to create your own wrapper function for 'write.table'.)

One might object to this line of explanation by noting that many 
functions already have many arguments and lots of features.  I think the 
situation is that the original author of any particular function gets to 
decide what features the function will have, and after that there is 
considerable reluctance (justifiably) to add new features, especially in 
cases where there desired functionality can be easily achieved in other 
ways with existing functions.

-- Tony Plate

Earl F. Glynn wrote:
> Consider:
> 
>>x <- matrix(1:6, 2,3)
>>rownames(x) <- c("ID1", "ID2")
>>colnames(x) <- c("Attr1", "Attr2", "Attr3")
> 
> 
>>x
> 
> Attr1 Attr2 Attr3
> ID1 1 3 5
> ID2 2 4 6
> 
> 
>>write.csv(x,file="x.csv")
> 
> "","Attr1","Attr2","Attr3"
> "ID1",1,3,5
> "ID2",2,4,6
> 
> Have I missed an easy way to get the "" string to be something meaningful?
> 
> There is no information in the "" string.  This column heading for the row
> names often could used as a database key, but the "" entry would need to be
> manually edited first.  Why not provide a way to specify the string instead
> of putting "" as the heading for the rownames?
> 
>>From http://finzi.psych.upenn.edu/R/doc/manual/R-data.html
> 
>   Header line
>   R prefers the header line to have no entry for the row names,
>   . . .
>   Some other systems require a (possibly empty) entry for the row names,
> which is what write.table will provide if argument col.names = NA  is
> specified. Excel is one such system.
> 
> Why is an "empty" entry the only option here?
> 
> A quick solution that comes to mind seems a bit kludgy:
> 
> 
>>y <- cbind(rownames(x), x)
>>colnames(y)[1] <- "ID"
>>y
> 
> IDAttr1 Attr2 Attr3
> ID1 "ID1" "1"   "3"   "5"
> ID2 "ID2" "2"   "4"   "6"
> 
> 
>>write.table(y, row.names=F, col.names=T, sep=",", file="y.csv")
> 
> "ID","Attr1","Attr2","Attr3"
> "ID1","1","3","5"
> "ID2","2","4","6"
> 
> Now the rownames have an "ID" header, which could be used as a key in a
> database if desired without editing (but all the "numbers" are now
> characters strings, too).
> 
> It's also not clear why I had to use write.table above, instead of
> write.csv:
> 
>>write.csv(y, row.names=F, col.names=T, file="y.csv")
> 
> Error in write.table(..., col.names = NA, sep = ",", qmethod = "double") :
> col.names = NA makes no sense when row.names = FALSE
> 
> Thanks for any insight about this.
> 
> efg
> --
> Earl F. Glynn
> Bioinformatics
> Stowers Institute
> 
> __
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Why only a "" string for heading for row.names with write.csv with a matrix?

2005-08-10 Thread Earl F. Glynn
Consider:
> x <- matrix(1:6, 2,3)
> rownames(x) <- c("ID1", "ID2")
> colnames(x) <- c("Attr1", "Attr2", "Attr3")

> x
Attr1 Attr2 Attr3
ID1 1 3 5
ID2 2 4 6

> write.csv(x,file="x.csv")
"","Attr1","Attr2","Attr3"
"ID1",1,3,5
"ID2",2,4,6

Have I missed an easy way to get the "" string to be something meaningful?

There is no information in the "" string.  This column heading for the row
names often could used as a database key, but the "" entry would need to be
manually edited first.  Why not provide a way to specify the string instead
of putting "" as the heading for the rownames?

>From http://finzi.psych.upenn.edu/R/doc/manual/R-data.html

  Header line
  R prefers the header line to have no entry for the row names,
  . . .
  Some other systems require a (possibly empty) entry for the row names,
which is what write.table will provide if argument col.names = NA  is
specified. Excel is one such system.

Why is an "empty" entry the only option here?

A quick solution that comes to mind seems a bit kludgy:

> y <- cbind(rownames(x), x)
> colnames(y)[1] <- "ID"
> y
IDAttr1 Attr2 Attr3
ID1 "ID1" "1"   "3"   "5"
ID2 "ID2" "2"   "4"   "6"

> write.table(y, row.names=F, col.names=T, sep=",", file="y.csv")
"ID","Attr1","Attr2","Attr3"
"ID1","1","3","5"
"ID2","2","4","6"

Now the rownames have an "ID" header, which could be used as a key in a
database if desired without editing (but all the "numbers" are now
characters strings, too).

It's also not clear why I had to use write.table above, instead of
write.csv:
> write.csv(y, row.names=F, col.names=T, file="y.csv")
Error in write.table(..., col.names = NA, sep = ",", qmethod = "double") :
col.names = NA makes no sense when row.names = FALSE

Thanks for any insight about this.

efg
--
Earl F. Glynn
Bioinformatics
Stowers Institute

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] RMySQL not loading on Mac OS X

2005-08-10 Thread Georg Otto
Hi,

I have a problem loading RMySQL 0.5-5 on Mac OS 10.4.2 running R 2.1.1.

I installed RMySQL using:

export PKG_CPPFLAGS="-I/usr/local/mysql/include"
export PKG_LIBS="-L/usr/local/mysql/lib -lmysqlclient"

R CMD INSTALL /Users/gwo/Desktop/RMySQL_0.5-5.tar.gz


The installation seemed to work ok, but when I load RMySQL in R I get  
an error message:

 >library(RMySQL)
Error in dyn.load(x, as.logical(local), as.logical(now)) :
 unable to load shared library '/Library/Frameworks/ 
R.framework/Resources/library/RMySQL/libs/RMySQL.so':
   dlopen(/Library/Frameworks/R.framework/Resources/library/RMySQL/ 
libs/RMySQL.so, 6): Symbol not found: _printf$LDBLStub
   Referenced from: /Library/Frameworks/R.framework/Resources/library/ 
RMySQL/libs/RMySQL.so
   Expected in: flat namespace
Error in library(RMySQL) : .First.lib failed for 'RMySQL'

Any hint will be highly appreciated!

Best,

Georg



-- 
Georg Wilhelm Otto
Max-Planck-Institute for Developmental Biology
Spemannstrasse 35/III
D-72076 Tuebingen Germany
phone: +49-7071-601 444
http://www.eb.tuebingen.mpg.de


[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] how to write assignment form of function

2005-08-10 Thread Prof Brian Ripley

On Wed, 10 Aug 2005, Heinz Tuechler wrote:


Dear Professor Ripley,

thank you for your answer. Adding a return value, as also Dimitris
Rizopoulos suggested the function does what I need, that is to rename
factor levels.
I tried to look at levels<-.factor in R-devel but I have to admit that I do
not know exactly where to look and searching I did not find it. For the


https://svn.r-project.org/R/trunk/src/library/base/R/factor.R


moment my problem is solved and I interpret your hint that way that in the
future levels<-.factor will not more drop all other attributes.


Yes, that's true.



Thanks again

Heinz Tüchler

At 15:18 10.08.2005 +0100, Prof Brian Ripley wrote:

On Wed, 10 Aug 2005, Heinz Tuechler wrote:


where can I find information about how to write an assigment form of a
function?


In all good books on S programming, or by studying examples.  But in this
case the problem is actually about defining functions with the return
value you expect.


For curiosity I tried to write a different form of the levels()-function,
since the original method for factor deletes all other attributes of a

factor.

Of course, the simple method would be to use instead of levels(x) <-
newlevels, attr(x, 'levels') <- newlevels.


And that would not do what the current function does, which is to merge
levels as required.

I suggest you look at levels<-.factor in R-devel, which does not drop
attributes.



I tried the following:
## example
x <- factor(c(1,1,NA,2,3,4,4,4,1,2)); y <- x
attr(x, 'levels') <- c('a', 'b', 'c', 'd') # does what I want
x
[1] aa bcdddab
Levels: a b c d

'levels.simple<-' <- function (x, value)
{
 attr(x, 'levels') <- value
}


This did not return anything!  Try returning 'x'.


levels.simple(y) <- c('a', 'b', 'c', 'd') # does not what I want
y
[1] "a" "b" "c" "d"



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








--
Brian D. Ripley,  [EMAIL PROTECTED]
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel:  +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UKFax:  +44 1865 272595__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Re: [R] how to write assignment form of function

2005-08-10 Thread Heinz Tuechler
Dear Professor Ripley,

thank you for your answer. Adding a return value, as also Dimitris
Rizopoulos suggested the function does what I need, that is to rename
factor levels.
I tried to look at levels<-.factor in R-devel but I have to admit that I do
not know exactly where to look and searching I did not find it. For the
moment my problem is solved and I interpret your hint that way that in the
future levels<-.factor will not more drop all other attributes.

Thanks again

Heinz Tüchler

At 15:18 10.08.2005 +0100, Prof Brian Ripley wrote:
>On Wed, 10 Aug 2005, Heinz Tuechler wrote:
>
>> where can I find information about how to write an assigment form of a
>> function?
>
>In all good books on S programming, or by studying examples.  But in this 
>case the problem is actually about defining functions with the return 
>value you expect.
>
>> For curiosity I tried to write a different form of the levels()-function,
>> since the original method for factor deletes all other attributes of a
factor.
>> Of course, the simple method would be to use instead of levels(x) <-
>> newlevels, attr(x, 'levels') <- newlevels.
>
>And that would not do what the current function does, which is to merge 
>levels as required.
>
>I suggest you look at levels<-.factor in R-devel, which does not drop 
>attributes.
>
>
>> I tried the following:
>> ## example
>> x <- factor(c(1,1,NA,2,3,4,4,4,1,2)); y <- x
>> attr(x, 'levels') <- c('a', 'b', 'c', 'd') # does what I want
>> x
>> [1] aa bcdddab
>> Levels: a b c d
>>
>> 'levels.simple<-' <- function (x, value)
>> {
>>  attr(x, 'levels') <- value
>> }
>
>This did not return anything!  Try returning 'x'.
>
>> levels.simple(y) <- c('a', 'b', 'c', 'd') # does not what I want
>> y
>> [1] "a" "b" "c" "d"
>
>
>-- 
>Brian D. Ripley,  [EMAIL PROTECTED]
>Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
>University of Oxford, Tel:  +44 1865 272861 (self)
>1 South Parks Road, +44 1865 272866 (PA)
>Oxford OX1 3TG, UKFax:  +44 1865 272595
>
>

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Question about curve fitting...

2005-08-10 Thread Dimitris Rizopoulos
I think here it's important to consider how the errors term come into 
the model. If "y = k1 * x^k2 * e" then in the log-scale you have a 
linear model; however if you assume that "y = k1 * x^k2 + e", the you 
want a nonlinear model (i.e., nls()). For instance,

x <- runif(500, 1, 3)
y <- 1 * x^2 + rnorm(500)
m <- nls(y ~ exp(k1 + k2 * log(x)), start = c("k1" = 1, "k2" = 2))
c(exp(coef(m)[1]), coef(m)[2])


I hope it helps.

Best,
Dimitris


Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven

Address: Kapucijnenvoer 35, Leuven, Belgium
Tel: +32/16/336899
Fax: +32/16/337015
Web: http://www.med.kuleuven.be/biostat/
 http://www.student.kuleuven.be/~m0390867/dimitris.htm


- Original Message - 
From: "Dan Bolser" <[EMAIL PROTECTED]>
To: "S.O. Nyangoma" <[EMAIL PROTECTED]>
Cc: "R mailing list" 
Sent: Wednesday, August 10, 2005 4:53 PM
Subject: Re: [R] Question about curve fitting...


> On Wed, 10 Aug 2005, S.O. Nyangoma wrote:
>
>>I see that
>>log(y)=log(k1)+k2*log(x)
>>use lm?
>
> Thats a nice solution in this instance, but in general how do I get 
> R to
> fit a particular function (formula) and return the parameters?
>
> Cheers,
> Dan.
>
>>
>>- Original Message -
>>From: Dan Bolser <[EMAIL PROTECTED]>
>>Date: Wednesday, August 10, 2005 11:41 am
>>Subject: [R] Question about curve fitting...
>>
>>>
>>> Meta:
>>> This question is somewhat long and has two parts, I would be very
>>> happyfor someone just to nudge me in the right direction with the
>>> manual /
>>> tutorial, as I am somewhat lost...
>>>
>>>
>>> 1) How do I fit a curve of the form "y = k1 * x^k2" ?
>>>
>>> I want to estimate values of k1 and k2 given the x/y data I have,
>>> and I
>>> can't work out how to get R to calculate and return their 
>>> estimates.
>>>
>>>
>>> 2) Given the value of k1 and k2 for population A, how can I test 
>>> if
>>> population B has significantly different values of k1 and k2?
>>>
>>> Sorry for the basic question. I think I just need to read up on a 
>>> few
>>> functions.
>>>
>>>
>>> I have about 50 xy pairs in total if that makes a difference.
>>>
>>> Dan.
>>>
>>> __
>>> R-help@stat.math.ethz.ch mailing list
>>> https://stat.ethz.ch/mailman/listinfo/r-help
>>> PLEASE do read the posting guide! 
>>> http://www.R-project.org/posting-
>>> guide.html
>>
>
> __
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html
>

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Question about curve fitting...

2005-08-10 Thread Berton Gunter
As you appeared to have received no reply ...

1) Use nls() on the original equation

2) Transforming first and using linear fitting is **NOT** the same. The
error structures differ and therefore you get different results. The
greatest effect is on inferences -- i.e confidence intervals for the
parameters: the usual asymptotic intervals would be symmetric based on the
original scale, asymmetric based on the transformed. For reasonably
well-behaved data the point estimates shouldn't be too much different,
however. In any case, the linearization is a good way to find starting
values.


-- Bert Gunter
Genentech Non-Clinical Statistics
South San Francisco, CA
 
"The business of the statistician is to catalyze the scientific learning
process."  - George E. P. Box
 
 

> -Original Message-
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of S.O. Nyangoma
> Sent: Wednesday, August 10, 2005 3:22 AM
> To: Dan Bolser
> Cc: R mailing list
> Subject: Re: [R] Question about curve fitting...
> 
> I see that 
> log(y)=log(k1)+k2*log(x)
> use lm?
> 
> - Original Message -
> From: Dan Bolser <[EMAIL PROTECTED]>
> Date: Wednesday, August 10, 2005 11:41 am
> Subject: [R] Question about curve fitting...
> 
> > 
> > Meta:
> > This question is somewhat long and has two parts, I would be very 
> > happyfor someone just to nudge me in the right direction with the 
> > manual /
> > tutorial, as I am somewhat lost...
> > 
> > 
> > 1) How do I fit a curve of the form "y = k1 * x^k2" ?
> > 
> > I want to estimate values of k1 and k2 given the x/y data I have, 
> > and I
> > can't work out how to get R to calculate and return their estimates.
> > 
> > 
> > 2) Given the value of k1 and k2 for population A, how can I test if
> > population B has significantly different values of k1 and k2?
> > 
> > Sorry for the basic question. I think I just need to read 
> up on a few
> > functions.
> > 
> > 
> > I have about 50 xy pairs in total if that makes a difference.
> > 
> > Dan.
> > 
> > __
> > R-help@stat.math.ethz.ch mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide! http://www.R-project.org/posting-
> > guide.html
> 
> __
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html
>

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Question about curve fitting...

2005-08-10 Thread Peter Dalgaard
Dan Bolser <[EMAIL PROTECTED]> writes:

> On Wed, 10 Aug 2005, S.O. Nyangoma wrote:
> 
> >I see that 
> >log(y)=log(k1)+k2*log(x)
> >use lm?
> 
> Thats a nice solution in this instance, but in general how do I get R to
> fit a particular function (formula) and return the parameters?

nls() is your friend.
 

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

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Question about curve fitting...

2005-08-10 Thread Dan Bolser
On Wed, 10 Aug 2005, S.O. Nyangoma wrote:

>I see that 
>log(y)=log(k1)+k2*log(x)
>use lm?

Thats a nice solution in this instance, but in general how do I get R to
fit a particular function (formula) and return the parameters?

Cheers,
Dan.

>
>- Original Message -
>From: Dan Bolser <[EMAIL PROTECTED]>
>Date: Wednesday, August 10, 2005 11:41 am
>Subject: [R] Question about curve fitting...
>
>> 
>> Meta:
>> This question is somewhat long and has two parts, I would be very 
>> happyfor someone just to nudge me in the right direction with the 
>> manual /
>> tutorial, as I am somewhat lost...
>> 
>> 
>> 1) How do I fit a curve of the form "y = k1 * x^k2" ?
>> 
>> I want to estimate values of k1 and k2 given the x/y data I have, 
>> and I
>> can't work out how to get R to calculate and return their estimates.
>> 
>> 
>> 2) Given the value of k1 and k2 for population A, how can I test if
>> population B has significantly different values of k1 and k2?
>> 
>> Sorry for the basic question. I think I just need to read up on a few
>> functions.
>> 
>> 
>> I have about 50 xy pairs in total if that makes a difference.
>> 
>> Dan.
>> 
>> __
>> R-help@stat.math.ethz.ch mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide! http://www.R-project.org/posting-
>> guide.html
>

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Exponential, Weibull and log-logistic distributions in glm()

2005-08-10 Thread Thomas Lumley
On Wed, 10 Aug 2005, Gorjanc Gregor wrote:

> Dear R-users!
>
> I would like to fit exponential, Weibull and log-logistic via glm() like
> functions. Does anyone know a way to do this? Bellow is a bit longer
> description of my problem.

I think you want to use survreg().  It will still work when there is no 
censoring.


Adding these families to glm() would be difficult. They are really not 
generalized linear models in any of the useful senses: not exponential 
families, don't have estimating functions linear in the response 
variable, not fitted by iteratively reweighted least squares.


-thomas

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Digest reading is tedious

2005-08-10 Thread Earl F. Glynn
"Dirk Eddelbuettel" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> The R-help (!!) list is available via Gmane.org, a fabulous service that
> archives, redirects, displays, ... a gazillion mailing lists. Among them
are
> are r-help, r-devel, and several r-sig-* lists.  See the top of
>
> http://dir.gmane.org/index.php?prefix=gmane.comp.lang.r
>
> for the current list. By Gmane's convention, -help or -user lists often
end
> up as '*.general'. So r-help is at

Reading these "newsgroups" is a great way to keep up with what's going on
with R without the daily digest tedium:
- gmane.comp.lang.r.general
- gmane.comp.lang.r.devel
- gmane.comp.lang.r.announce

The BioConductor mailing list is also there, but I find its name a bit odd:
- gmane.science.biology.informatics.conductor

The name makes some sense, but I missed it for months because it didn't have
"bioconductor" exactly in the name.

efg

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] date format

2005-08-10 Thread bogdan romocea
You need the day to convert to a date format. Assuming day=15:
x.date <- as.Date(paste(as.character(x),"-15",sep=""),format="%Y-%m-%d")


> -Original Message-
> From: alessandro carletti [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, August 10, 2005 9:37 AM
> To: rHELP
> Subject: [R] date format
> 
> 
> Hi,
> I have a problem with a vector (x) containing dates in
> format "-mm" (I'm working with monthly means): how
> can I convert it in date format, so that I can plot it
> recognising trends for my variables?
> class(x) says: factor
> Thanks
> Alex
> 
> __
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html
>

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] how to write assignment form of function

2005-08-10 Thread Prof Brian Ripley
On Wed, 10 Aug 2005, Heinz Tuechler wrote:

> where can I find information about how to write an assigment form of a
> function?

In all good books on S programming, or by studying examples.  But in this 
case the problem is actually about defining functions with the return 
value you expect.

> For curiosity I tried to write a different form of the levels()-function,
> since the original method for factor deletes all other attributes of a factor.
> Of course, the simple method would be to use instead of levels(x) <-
> newlevels, attr(x, 'levels') <- newlevels.

And that would not do what the current function does, which is to merge 
levels as required.

I suggest you look at levels<-.factor in R-devel, which does not drop 
attributes.


> I tried the following:
> ## example
> x <- factor(c(1,1,NA,2,3,4,4,4,1,2)); y <- x
> attr(x, 'levels') <- c('a', 'b', 'c', 'd') # does what I want
> x
> [1] aa bcdddab
> Levels: a b c d
>
> 'levels.simple<-' <- function (x, value)
> {
>  attr(x, 'levels') <- value
> }

This did not return anything!  Try returning 'x'.

> levels.simple(y) <- c('a', 'b', 'c', 'd') # does not what I want
> y
> [1] "a" "b" "c" "d"


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

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Problems with numeric variable containing ? values

2005-08-10 Thread ftorrei2
Hello,

I have a problem with the values for one column in a table.
The variable represented in this column is numeric (I get TRUE
when I ask is.numeric(x)). However, the values are listed
ordinally and with row numbers as values, not with the ones
that appear in the table. Some rows have an undefined value
for this column, which appears as ? in the table (this is not
an error). I wonder whether these undefined values are causing
the problem.
I need to extract a subset from this column with all rows not
having '?' and then use the subset for a number if analysis.
So far this is not possible since the subset does not have the
real values, but the row numbers mentioned above. Any help?

Thanks in advance,
Francisco Torreira 
Francisco Torreira
Spanish, Italian and Portuguese
Univ. of Illinois at Urbana-Champaign
707 South Mathews Aven.
4031 FLB
Urbana, IL, 61801

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Plit result of pairs in an Sweave compatible manner

2005-08-10 Thread Christian Hoffmann
Hi,

I want to use "pairs" on a fairly big matrix, say more than 30 columns. 
R tries to fit this on one page, which results in tiny invidual 
rectangles, and dots are hard to see.

Is there a way to transform the output of pairs in a way that subplots 
of 10*10, say, rectangles are generated. These subplots should then go 
to Sweave which is accepting one figure at a time presently.

Thanks for help
Christian Hoffmann

PS: In the old S (The New S language, Becker, Chambers, Wilks) there was 
a parameter "max" to split the output.
-- 
Dr. Christian W. Hoffmann,
Swiss Federal Research Institute WSL
Mathematics + Statistical Computing
Zuercherstrasse 111
CH-8903 Birmensdorf, Switzerland

Tel +41-44-7392-277  (office)   -111(exchange)
Fax +41-44-7392-215  (fax)
[EMAIL PROTECTED]
http://www.wsl.ch/staff/christian.hoffmann

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] date format

2005-08-10 Thread alessandro carletti
Hi,
I have a problem with a vector (x) containing dates in
format "-mm" (I'm working with monthly means): how
can I convert it in date format, so that I can plot it
recognising trends for my variables?
class(x) says: factor
Thanks
Alex

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] how to write assignment form of function

2005-08-10 Thread Heinz Tuechler
At 14:49 10.08.2005 +0200, Dimitris Rizopoulos wrote:
>take a look at e.g., get("levels<-.factor"); you should return "x" in 
>your function, i.e.,
>
>y <- x <- factor(c(1,1,NA,2,3,4,4,4,1,2))
>
>'levels.simple<-' <- function(x, value){
>  attr(x, 'levels') <- value
>  x
> }
>
>levels.simple(y) <- c('a', 'b', 'c', 'd')
>y
>
>
>I hope it helps.
>
>Best,
>Dimitris
>
Dear Dimitris,

Thank you a lot - it helped. Now it works.

Heinz



>
>Dimitris Rizopoulos
>Ph.D. Student
>Biostatistical Centre
>School of Public Health
>Catholic University of Leuven
>
>Address: Kapucijnenvoer 35, Leuven, Belgium
>Tel: +32/16/336899
>Fax: +32/16/337015
>Web: http://www.med.kuleuven.be/biostat/
> http://www.student.kuleuven.be/~m0390867/dimitris.htm
>
>
>- Original Message - 
>From: "Heinz Tuechler" <[EMAIL PROTECTED]>
>To: 
>Sent: Wednesday, August 10, 2005 2:24 PM
>Subject: [R] how to write assignment form of function
>
>
>Dear All,
>
>where can I find information about how to write an assigment form of a
>function?
>For curiosity I tried to write a different form of the 
>levels()-function,
>since the original method for factor deletes all other attributes of a 
>factor.
>Of course, the simple method would be to use instead of levels(x) <-
>newlevels, attr(x, 'levels') <- newlevels.
>
>I tried the following:
>## example
>x <- factor(c(1,1,NA,2,3,4,4,4,1,2)); y <- x
>attr(x, 'levels') <- c('a', 'b', 'c', 'd') # does what I want
>x
> [1] aa bcdddab
>Levels: a b c d
>
>'levels.simple<-' <- function (x, value)
> {
>  attr(x, 'levels') <- value
> }
>
>levels.simple(y) <- c('a', 'b', 'c', 'd') # does not what I want
>y
>[1] "a" "b" "c" "d"
>
>Thanks,
>Heinz Tüchler
>
>__
>R-help@stat.math.ethz.ch mailing list
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide! 
>http://www.R-project.org/posting-guide.html
>
>

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Not loading libraries

2005-08-10 Thread Fredrik Karlsson
Dear list,

I'm sorry about not providing all the necessary details. The R call is: 

"library(tools); Sweave(\"$*.Rnw\")" | R --no-save -q

Using the --vanilla switch, I am able to keep the libraries  from
loading, but since I need some of the datasets in the .RData file, my
call to Sweave fails.
I have not been able to find loading of libraries in an ,Rprofile, and
my options contains this:

> options("defaultPackages")
$defaultPackages
[1] "datasets"  "utils" "grDevices" "graphics"  "stats" "methods"  

Prof. Ripley is right when assuming that the libraries are loaded
because of me trying out the Rcmdr GUI and then doing a save.image().
What I did not know was that I managed to  save the loading of
libraries at the same time. This is what I would like to undo.

/Fredrik




On 8/10/05, Prof Brian Ripley <[EMAIL PROTECTED]> wrote:
> On Wed, 10 Aug 2005, Fredrik Karlsson wrote:
> 
> > I have a bunch of libraries that are automatically loaded when I start
> > the R environment. How do I remove them?
> 
> By undoing what you did to get them there.
> 
> `make' is not the usual way to start R: try R --vanilla and see what
> happens (probably none of this).  Then read ?Startup and try just 'R'.
> 
> My guess is that has something to do loading Rcmdr afer having set R to
> run with no default packages, but we have no evidence of how you ran R.
> 
> > Output:
> > [EMAIL PROTECTED]:~/dokument/Thesis/Book$ make
> > Making file voicing.tex from voicing.Rnw
> > Loading Tcl/Tk interface ... done
> > Loading required package: tcltk
> > Loading required package: rgl
> > Loading required package: zoo
> > Loading required package: strucchange
> > Loading required package: sandwich
> > Loading required package: relimp
> > Loading required package: nnet
> > Loading required package: graphics
> > Loading required package: grDevices
> > Loading required package: stats
> > Loading required package: nlme
> > Loading required package: mvtnorm
> > Loading required package: multcomp
> > Loading required package: mgcv
> > This is mgcv 1.3-1
> > Loading required package: MASS
> > Loading required package: lmtest
> > Loading required package: lattice
> > Loading required package: grid
> > Loading required package: foreign
> > Loading required package: effects
> > Loading required package: car
> > Loading required package: abind
> >> library(tools); Sweave("voicing.Rnw")
> > 
> 
> --
> Brian D. Ripley,  [EMAIL PROTECTED]
> Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
> University of Oxford, Tel:  +44 1865 272861 (self)
> 1 South Parks Road, +44 1865 272866 (PA)
> Oxford OX1 3TG, UKFax:  +44 1865 272595
>

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] clip to keep coordinate system?

2005-08-10 Thread ivo_welch-rstat8303

Dear wizards:

despite my omission of the c() on the limits, a kind soul sent me the 
answer: a par(new=T) will make the next plot() redraw nicely.

a help question for  R-2.1.0:  help.search("transparent")  gives
"No help files found with alias or concept or title matching 
'transparent' using fuzzy matching."
but "?par" has the word transparent in the color specification section 
(though an example of usage would make this one much clearer, too).  
shouldn't help.search() look through the build-in docs, too?

sincerely, /iaw

---
ivo welch

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] how to write assignment form of function

2005-08-10 Thread Dimitris Rizopoulos
take a look at e.g., get("levels<-.factor"); you should return "x" in 
your function, i.e.,

y <- x <- factor(c(1,1,NA,2,3,4,4,4,1,2))

'levels.simple<-' <- function(x, value){
  attr(x, 'levels') <- value
  x
 }

levels.simple(y) <- c('a', 'b', 'c', 'd')
y


I hope it helps.

Best,
Dimitris


Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven

Address: Kapucijnenvoer 35, Leuven, Belgium
Tel: +32/16/336899
Fax: +32/16/337015
Web: http://www.med.kuleuven.be/biostat/
 http://www.student.kuleuven.be/~m0390867/dimitris.htm


- Original Message - 
From: "Heinz Tuechler" <[EMAIL PROTECTED]>
To: 
Sent: Wednesday, August 10, 2005 2:24 PM
Subject: [R] how to write assignment form of function


Dear All,

where can I find information about how to write an assigment form of a
function?
For curiosity I tried to write a different form of the 
levels()-function,
since the original method for factor deletes all other attributes of a 
factor.
Of course, the simple method would be to use instead of levels(x) <-
newlevels, attr(x, 'levels') <- newlevels.

I tried the following:
## example
x <- factor(c(1,1,NA,2,3,4,4,4,1,2)); y <- x
attr(x, 'levels') <- c('a', 'b', 'c', 'd') # does what I want
x
 [1] aa bcdddab
Levels: a b c d

'levels.simple<-' <- function (x, value)
 {
  attr(x, 'levels') <- value
 }

levels.simple(y) <- c('a', 'b', 'c', 'd') # does not what I want
y
[1] "a" "b" "c" "d"

Thanks,
Heinz Tüchler

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! 
http://www.R-project.org/posting-guide.html

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] R equivalent to Fortran, GAUSS, or Perl's "goto"

2005-08-10 Thread Warren Lamboy
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Barry Rowlingson
Sent: Wednesday, August 10, 2005 5:23 AM
To: r-help@stat.math.ethz.ch
Subject: Re: [R] R equivalent to Fortran, GAUSS, or Perl's "goto"


Warren Lamboy wrote:
> Does R have something equivalent to the "goto" in Perl?
> If so, can you please tell me what it is?  I cannot find
> it in the Ref Manual or the Language Manual.

What was true in 1968 is still true now:

http://www.acm.org/classics/oct95/

Of course Perl has one, but then in Perl there's always more than one 
way to shoot yourself in the foot.

Baz



Does that mean the answer to my first question is "No"?

Warren

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] invalid 'mode' of argument?

2005-08-10 Thread Jari Oksanen
On Wed, 2005-08-10 at 08:13 -0400, Kang, Sang-Hoon wrote:

> As a novice I was trying to calculate Shannon diversity index using
> diversity function in vegan package and kept having same error message.
> Error in sum(..., na.rm = na.rm) : invalid 'mode' of argument
> 
This error (which is from sum()) seems to come if you have non-numeric
data (factors, character variables etc.). Check that your data are
strictly numeric. Some of the most common cases I've seen are that row
or column names are not read as row and column names but as data rows or
columns. 
> 
> My dataset is from microarray and have abundant missing values, so I
> tried labeling them as NA and 0, but still same error message.

> Shannon index is negative sum of proportion times log of proportion, so
> I put 1 for missing values to avoid log 0, but still same error message.
> 
You shouldn't forge your data: the function handles zeros.

PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

cheers, jari oksanen
-- 
Jari Oksanen -- Dept Biology, Univ Oulu, 90014 Oulu, Finland
email [EMAIL PROTECTED], homepage http://cc.oulu.fi/~jarioksa/

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] R equivalent to Fortran, GAUSS, or Perl's "goto"

2005-08-10 Thread roger bos
The best thing to do would be to provide an example of how you want to
use the goto, then someone can probably suggest a work around or an
alternative way of doing the same thing, once we have something
concrete to go on.

Thanks,
Roger

On 8/15/05, Warren Lamboy <[EMAIL PROTECTED]> wrote:
> Does R have something equivalent to the "goto" in Perl?
> If so, can you please tell me what it is?  I cannot find
> it in the Ref Manual or the Language Manual.
> 
> Thanks.
> 
> -  Warren
> 
> 
> 
> Warren Lamboy
> USDA-ARS Plant Genetic Resources Unit
> Geneva, NY, USA  14456
> 
> __
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] how to write assignment form of function

2005-08-10 Thread Heinz Tuechler
Dear All,

where can I find information about how to write an assigment form of a
function?
For curiosity I tried to write a different form of the levels()-function,
since the original method for factor deletes all other attributes of a factor.
Of course, the simple method would be to use instead of levels(x) <-
newlevels, attr(x, 'levels') <- newlevels.

I tried the following:
## example
x <- factor(c(1,1,NA,2,3,4,4,4,1,2)); y <- x
attr(x, 'levels') <- c('a', 'b', 'c', 'd') # does what I want
x
 [1] aa bcdddab   
Levels: a b c d
 
'levels.simple<-' <- function (x, value) 
 {
  attr(x, 'levels') <- value
 }
 
levels.simple(y) <- c('a', 'b', 'c', 'd') # does not what I want
y
[1] "a" "b" "c" "d"
 
Thanks,
Heinz Tüchler

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] invalid 'mode' of argument?

2005-08-10 Thread Kang, Sang-Hoon
Dear Colleagues,

 

As a novice I was trying to calculate Shannon diversity index using
diversity function in vegan package and kept having same error message.

 

Error in sum(..., na.rm = na.rm) : invalid 'mode' of argument

 

My dataset is from microarray and have abundant missing values, so I
tried labeling them as NA and 0, but still same error message.

 

Shannon index is negative sum of proportion times log of proportion, so
I put 1 for missing values to avoid log 0, but still same error message.

 

What do you think I'm missing here?

 

Many thanks in advance.

 

Sanghoon Kang.

 


[[alternative HTML version deleted]]

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Not loading libraries

2005-08-10 Thread Prof Brian Ripley
On Wed, 10 Aug 2005, Fredrik Karlsson wrote:

> I have a bunch of libraries that are automatically loaded when I start
> the R environment. How do I remove them?

By undoing what you did to get them there.

`make' is not the usual way to start R: try R --vanilla and see what 
happens (probably none of this).  Then read ?Startup and try just 'R'.

My guess is that has something to do loading Rcmdr afer having set R to 
run with no default packages, but we have no evidence of how you ran R.

> Output:
> [EMAIL PROTECTED]:~/dokument/Thesis/Book$ make
> Making file voicing.tex from voicing.Rnw
> Loading Tcl/Tk interface ... done
> Loading required package: tcltk
> Loading required package: rgl
> Loading required package: zoo
> Loading required package: strucchange
> Loading required package: sandwich
> Loading required package: relimp
> Loading required package: nnet
> Loading required package: graphics
> Loading required package: grDevices
> Loading required package: stats
> Loading required package: nlme
> Loading required package: mvtnorm
> Loading required package: multcomp
> Loading required package: mgcv
> This is mgcv 1.3-1
> Loading required package: MASS
> Loading required package: lmtest
> Loading required package: lattice
> Loading required package: grid
> Loading required package: foreign
> Loading required package: effects
> Loading required package: car
> Loading required package: abind
>> library(tools); Sweave("voicing.Rnw")
> 

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

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Exponential, Weibull and log-logistic distributions in glm()

2005-08-10 Thread Gorjanc Gregor
Dear R-users!

I would like to fit exponential, Weibull and log-logistic via glm() like
functions. Does anyone know a way to do this? Bellow is a bit longer 
description of my problem.

Hm, could family() be adjusted/improved/added to allow for these distributions?
SAS procedure GENMOD alows to specify deviance and variance functions to
help in such cases. I have not tried that option and I do not know how
does it work. I do not expect that others will do the job, although it 
would not harm ;)

Thanks in advance!

I fully understand that all mentioned distributiones are available through
"survival" functions in various packages but I don't have data that 
correspond fully to survival data. I have data on some cell parameters,
which show cell vitality. These data are highly skewed and I have
therefore modeled them via log-normal and gamma in glm(). Based
on deviance residuals, gamma seems to fit better. By the way, are there any
other means of chosing the right disribution for GLM?

However, some references from field of this data suggested that Weibull might
be better and I would like to try this, as well as with exponential and 
log-logistic. Of course, author in that paper did not say how they performed
the analyses, but I guess they took each group (several group were compared) 
separately and estimated parameters for distribution, say Weibull, via maximum 
likelhood. I do not like this approach, since not all data are used in one run, 
and would like to use model to get parameter estimates and perform inference.
With Weibull I am aware that it does not fit in exponential family, unless one
is read to specify a value/estimate for one parameter.

Any comment are welcome!

Lep pozdrav / With regards,
Gregor Gorjanc

--
University of Ljubljana
Biotechnical FacultyURI: http://www.bfro.uni-lj.si/MR/ggorjan
Zootechnical Department mail: gregor.gorjanc  bfro.uni-lj.si
Groblje 3   tel: +386 (0)1 72 17 861
SI-1230 Domzale fax: +386 (0)1 72 17 888
Slovenia, Europe
--
"One must learn by doing the thing; for though you think you know it,
 you have no certainty until you try." Sophocles ~ 450 B.C.

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Not loading libraries

2005-08-10 Thread Fredrik Karlsson
Dear list,

I have a bunch of libraries that are automatically loaded when I start
the R environment. How do I remove them?

Output:
[EMAIL PROTECTED]:~/dokument/Thesis/Book$ make
Making file voicing.tex from voicing.Rnw
Loading Tcl/Tk interface ... done
Loading required package: tcltk
Loading required package: rgl
Loading required package: zoo
Loading required package: strucchange
Loading required package: sandwich
Loading required package: relimp
Loading required package: nnet
Loading required package: graphics
Loading required package: grDevices
Loading required package: stats
Loading required package: nlme
Loading required package: mvtnorm
Loading required package: multcomp
Loading required package: mgcv
This is mgcv 1.3-1
Loading required package: MASS
Loading required package: lmtest
Loading required package: lattice
Loading required package: grid
Loading required package: foreign
Loading required package: effects
Loading required package: car
Loading required package: abind
> library(tools); Sweave("voicing.Rnw")


/Fredrik

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] RGUI crash when opening script in XP Home enviroment

2005-08-10 Thread Knut Krueger


Prof Brian Ripley schrieb:

>This is not the place to report reproducible faults: please see the
>posting guide and send a complete bug report to the appropriate place.
>(Let alone three followups from Duncan Mackay!)
>  
>
Thank´s for the hint I sent the error (including the following url) to 
the Bug tracing system, but I also thought that the user here should 
know how to prevent the error.
I lost a lot of time with rewriting scripts which were not saved before 
I opened a new one until I realized the reason of this.

>However, as I don't know what the `open file button' is, I cannot
>reproduce it.  Is this MDI or SDI mode, 
>
Sorry about this, but I don not know the difference and I do not know 
what the shortcuts are standing for
   

>and if the former is this using
>the icon on the toolbar, whose tooltip says it is `open script'?
>
Yes this one but not the 'file -> open script' 
line

>
>Please make clear in your report if this one or two problems, i.e. is the 
>`not closing completely' only after the error?
>  
>
The report with screen prints is available (I'm sorry that it is a 
German operating system):
http://www.biostatistic.de/forum/messages/2291/2350.html

I hope this is clarifying the open questions

with regards
Knut Krueger
http://www.biostatistic.de

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Question about curve fitting...

2005-08-10 Thread S.O. Nyangoma
I see that 
log(y)=log(k1)+k2*log(x)
use lm?

- Original Message -
From: Dan Bolser <[EMAIL PROTECTED]>
Date: Wednesday, August 10, 2005 11:41 am
Subject: [R] Question about curve fitting...

> 
> Meta:
> This question is somewhat long and has two parts, I would be very 
> happyfor someone just to nudge me in the right direction with the 
> manual /
> tutorial, as I am somewhat lost...
> 
> 
> 1) How do I fit a curve of the form "y = k1 * x^k2" ?
> 
> I want to estimate values of k1 and k2 given the x/y data I have, 
> and I
> can't work out how to get R to calculate and return their estimates.
> 
> 
> 2) Given the value of k1 and k2 for population A, how can I test if
> population B has significantly different values of k1 and k2?
> 
> Sorry for the basic question. I think I just need to read up on a few
> functions.
> 
> 
> I have about 50 xy pairs in total if that makes a difference.
> 
> Dan.
> 
> __
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-
> guide.html

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Question about curve fitting...

2005-08-10 Thread Dan Bolser

Meta:
This question is somewhat long and has two parts, I would be very happy
for someone just to nudge me in the right direction with the manual /
tutorial, as I am somewhat lost...


1) How do I fit a curve of the form "y = k1 * x^k2" ?

I want to estimate values of k1 and k2 given the x/y data I have, and I
can't work out how to get R to calculate and return their estimates.


2) Given the value of k1 and k2 for population A, how can I test if
population B has significantly different values of k1 and k2?

Sorry for the basic question. I think I just need to read up on a few
functions.


I have about 50 xy pairs in total if that makes a difference.

Dan.

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] R equivalent to Fortran, GAUSS, or Perl's "goto"

2005-08-10 Thread Barry Rowlingson
Warren Lamboy wrote:
> Does R have something equivalent to the "goto" in Perl?
> If so, can you please tell me what it is?  I cannot find
> it in the Ref Manual or the Language Manual.

What was true in 1968 is still true now:

http://www.acm.org/classics/oct95/

Of course Perl has one, but then in Perl there's always more than one 
way to shoot yourself in the foot.

Baz

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Treatment-response analysis along time

2005-08-10 Thread Peter Dalgaard
"Felix Royo" <[EMAIL PROTECTED]> writes:

> Dear R people,
> I wonder if you could give me a hand with some of my data. I have a very 
> typical analysis in biology, however it is difficult for me to find the 
> right way to analyse. I had a group of animals, I gave them a treatment, and 
> I measure a variable along time -one´s per day- along 5 days,for 
> example(fake data):
> Animals Time1 Time2 Time3 Time4
> 11 531
> 22 741
> 35 531
> 41 372
> 52 771
> Please, notice that all the animals get the same treatment, and there are no 
>   control -animals which has no received any treatment.
> Normally I handle this kind of data with SPSS and Repeated Measurement 
> analysis. That tell me if there is a change along the time, but no 
> information about when the treatment start to be effective, when the effect 
> has pass. Besides, i would like to be able to handle this data with R.
> I have been looking at Crawley's S-plus book, and I cannot find similar 
> example as I have, not either in the Dalgaard´s introduction to R, because 
> he uses an example where different animals are measured as each time -using 
> time as a factor in a one way anova (I am hope I am right).
> Thanks for your help and time.
> Best regards
> Felix

ISwR is hardly an extensive treatise on repeated measurements, but
two-way ANOVA *is* in there (Section 6.3 and 10.6 for the replicated
case). Notice that you need a different data layout for that,
basically the result of a reshape(...direction="long"). 

Also, the capabilities of the newer mlm methods are relevant for this
kind of data (see ?anova.mlm, and the examples).

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

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] R equivalent to Fortran, GAUSS, or Perl's "goto"

2005-08-10 Thread Warren Lamboy
Does R have something equivalent to the "goto" in Perl?
If so, can you please tell me what it is?  I cannot find
it in the Ref Manual or the Language Manual.

Thanks.  

-  Warren



Warren Lamboy
USDA-ARS Plant Genetic Resources Unit
Geneva, NY, USA  14456

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] error loading nlme package

2005-08-10 Thread Uwe Ligges
Krishna wrote:

> Hi everyone
> 
> The suggestion I received from Mr. Dimitris Rizopoulos and Mr. Gabor
> Grothendieck seems to work well. But unfortunately when I am trying to
> load nlme package, the following error message is generated. Please
> help me on this, at the earliest.
> 
> 
>>library(nlme)
> 
> Error in loadNamespace(i, c(lib.loc, .libPaths()), keep.source) : 
> There is no package called 'lattice'
> In addition: Warning message: 
> package 'nlme' was built under R version 2.0.1 
> Error in library(nlme) : package/namespace load failed for 'nlme'


Your whole setup seems to be seriously broken.
Please reinstall R (and that's the best time to upgrade to R-2.1.1).

Uwe Ligges

> Though i am using the version R 2.0.0. A couple of hours back it was
> loaded, in the new session this problem is generated.
> 
> regards
> Krishna
> 
> __
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] RGUI crash when opening script in XP Home enviroment

2005-08-10 Thread Prof Brian Ripley
This is not the place to report reproducible faults: please see the
posting guide and send a complete bug report to the appropriate place.
(Let alone three followups from Duncan Mackay!)

However, as I don't know what the `open file button' is, I cannot
reproduce it.  Is this MDI or SDI mode, and if the former is this using
the icon on the toolbar, whose tooltip says it is `open script'?
 ^^
What did you expect that to do?

Please make clear in your report if this one or two problems, i.e. is the 
`not closing completely' only after the error?

This looks like yet another problem caused by adding the script editor, 
since prior to that there was pager toolbar.


On Wed, 10 Aug 2005, Knut Krueger wrote:

>
>
> Knut Krueger schrieb:
>
>> If  there is a helpfile open (f.e ?glm) and it is the top window, then
>> an exception error occurs (closing RGUI)
>> when I hit the open file button.
>> If the helpfile is not the top window (of the RGUI) I am able to open a
>> new script without any error.
>> The RGUI is not closing complete there is a blank screen left which I
>> have to close with the X Button or Taskmanager
>>
>> Windows XP Home - German Version updates installed.
>>
>> R-Version 2.1.0
>>
>> I
>>
> And it is the same problem with the 2.1.1 patched version
> http://www.cran.r-project.org/bin/windows/base/rpatched.html
>
> with regards
> Knut Krueger
> http://www.biostatistic.de
>
> __
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>

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

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] Treatment-response analysis along time

2005-08-10 Thread Dimitris Rizopoulos
you haven't told us what kind of variable you measure, but either way 
look at lmer() function in lme4 package which fits both linear and 
generalized linear mixed-effects models.

I hope it helps.

Best,
Dimitris


Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven

Address: Kapucijnenvoer 35, Leuven, Belgium
Tel: +32/16/336899
Fax: +32/16/337015
Web: http://www.med.kuleuven.be/biostat/
 http://www.student.kuleuven.be/~m0390867/dimitris.htm


- Original Message - 
From: "Felix Royo" <[EMAIL PROTECTED]>
To: 
Sent: Wednesday, August 10, 2005 9:09 AM
Subject: [R] Treatment-response analysis along time


Dear R people,
I wonder if you could give me a hand with some of my data. I have a 
very
typical analysis in biology, however it is difficult for me to find 
the
right way to analyse. I had a group of animals, I gave them a 
treatment, and
I measure a variable along time -one´s per day- along 5 days,for
example(fake data):
Animals Time1 Time2 Time3 Time4
11 531
22 741
35 531
41 372
52 771
Please, notice that all the animals get the same treatment, and there 
are no
  control -animals which has no received any treatment.
Normally I handle this kind of data with SPSS and Repeated Measurement
analysis. That tell me if there is a change along the time, but no
information about when the treatment start to be effective, when the 
effect
has pass. Besides, i would like to be able to handle this data with R.
I have been looking at Crawley's S-plus book, and I cannot find 
similar
example as I have, not either in the Dalgaard´s introduction to R, 
because
he uses an example where different animals are measured as each 
time -using
time as a factor in a one way anova (I am hope I am right).
Thanks for your help and time.
Best regards
Felix

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! 
http://www.R-project.org/posting-guide.html

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] HPD credible sets

2005-08-10 Thread pantd
Hi R users
Is there a function in R that gives HPD credible sets.  i googled it but was in
vain!

- dev

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


[R] Treatment-response analysis along time

2005-08-10 Thread Felix Royo
Dear R people,
I wonder if you could give me a hand with some of my data. I have a very 
typical analysis in biology, however it is difficult for me to find the 
right way to analyse. I had a group of animals, I gave them a treatment, and 
I measure a variable along time -one´s per day- along 5 days,for 
example(fake data):
Animals Time1 Time2 Time3 Time4
11 531
22 741
35 531
41 372
52 771
Please, notice that all the animals get the same treatment, and there are no 
  control -animals which has no received any treatment.
Normally I handle this kind of data with SPSS and Repeated Measurement 
analysis. That tell me if there is a change along the time, but no 
information about when the treatment start to be effective, when the effect 
has pass. Besides, i would like to be able to handle this data with R.
I have been looking at Crawley's S-plus book, and I cannot find similar 
example as I have, not either in the Dalgaard´s introduction to R, because 
he uses an example where different animals are measured as each time -using 
time as a factor in a one way anova (I am hope I am right).
Thanks for your help and time.
Best regards
Felix

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


Re: [R] RGUI crash when opening script in XP Home enviroment

2005-08-10 Thread Knut Krueger


Knut Krueger schrieb:

>If  there is a helpfile open (f.e ?glm) and it is the top window, then 
>an exception error occurs (closing RGUI)
>when I hit the open file button.
>If the helpfile is not the top window (of the RGUI) I am able to open a 
>new script without any error.
>The RGUI is not closing complete there is a blank screen left which I 
>have to close with the X Button or Taskmanager
>
>Windows XP Home - German Version updates installed.
>
>R-Version 2.1.0
>
>I
>
And it is the same problem with the 2.1.1 patched version 
http://www.cran.r-project.org/bin/windows/base/rpatched.html

with regards
Knut Krueger
http://www.biostatistic.de

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html