Re: [R] is it possible to form matrix of matrices...and multiple arrays

2005-09-29 Thread vincent
booop booop a écrit :

 1...Kindly tell me is it possible to form 
 a matrix which contains a no of matrices.. for eg..
 if a,b,c,d are matrices
 and e is a matrix which contains a,b,c,d as rows and columns..

I don't think you can use matrix() to store other matrix() inside.
But array() is a solution to store matrix() inside.
(At least I have use it).

__
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] Plot Data Points in boxplots

2005-09-29 Thread vincent
Paul Murrell a écrit :

 You might also like to take a look at Figure 3.27 
 (and associated R code) on
 http://www.stat.auckland.ac.nz/~paul/RGraphics/chapter3.html

Thank you very much for making this page available.
The power of R graphics, and the number of options,
makes such examples very useful.
(At least for beginners like me !)
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] Plot Data Points in boxplots

2005-09-29 Thread Martin Maechler
 vincent == vincent  [EMAIL PROTECTED]
 on Thu, 29 Sep 2005 08:30:10 +0200 writes:

vincent Paul Murrell a écrit :
 You might also like to take a look at Figure 3.27 (and
 associated R code) on
 http://www.stat.auckland.ac.nz/~paul/RGraphics/chapter3.html

vincent Thank you very much for making this page available.
vincent The power of R graphics, and the number of options,
vincent makes such examples very useful.  (At least for
vincent beginners like me !)  Thanks.

To really thank Paul, you should buy the book to which the above
web page refers :
  http://www.stat.auckland.ac.nz/~paul/RGraphics/rgraphics.html

A very nice and useful book to have, indeed!

Martin Maechler, ETH Zurich

__
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-level in packages mgcv and gam

2005-09-29 Thread Henric Nilsson
Yves Magliulo said the following on 2005-09-28 17:05:
 hi,
 
 i'll try to help you, i send a mail about this subject last week... and
 i did not have any response...
 
 I'm using gam from package mgcv. 
 
 1)
 How to interpret the significance of smooth terms is hard for me to
 understand perfectly : 
 using UBRE, you fix df. p-value are estimated by chi-sq distribution 
 using GCV, the best df are estimated by GAM. (that's what i want) and
 p-values 

This is not correct. The df are estimated in both cases (i.e. UBRE and 
GCV), but the scale parameter is fixed in the UBRE case. Hence, by 
default UBRE is used for family = binomial or poisson since the scale 
parameter is assumed to be 1. Similarly, GCV is the default for family = 
gaussian since we most often want the scale (usually denoted sigma^2) to 
be estimated.

 are estimated by an F distribution But in that case they said use at
 your own risk in ?summary.gam

The warning applies in both cases. The p-values are conditional on the 
smoothing parameters, and the uncertainty of the smooths is not taken 
into account when computing the p-values.

 so you can also look at the chi.sq : but i don't know how to choose a

No...

 criterion like for p-values... for me, chi.sq show the best predictor in
 a model, but it's hard to reject one with it.

Which version of mgcv do you use? The confusion probably stems from 
earlier versions of mgcv ( 1.3-5): the summary and anova methods used 
to have a column denoted Chi.sq even when the displayed statistic was 
computed as F. Recent versions of mgcv has

  summary(b)

Family: gaussian
Link function: identity

Formula:
y ~ s(x0) + s(x1) + s(x2) + s(x3)

Parametric coefficients:
 Estimate Std. Error t value Pr(|t|)
(Intercept)   7.9150 0.1049   75.44   2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Approximate significance of smooth terms:
 edf Est.rank  F  p-value
s(x0) 5.1739.000  3.785 0.000137 ***
s(x1) 2.3579.000 34.631   2e-16 ***
s(x2) 8.5179.000 84.694   2e-16 ***
s(x3) 1.0001.000  0.444 0.505797
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

R-sq.(adj) =  0.726   Deviance explained = 73.7%
GCV score =  4.611   Scale est. = 4.4029n = 400


If we assume that the scale is known and fixed at 4.4029, we get

  summary(b, dispersion = 4.4029)

Family: gaussian
Link function: identity

Formula:
y ~ s(x0) + s(x1) + s(x2) + s(x3)

Parametric coefficients:
 Estimate Std. Error z value Pr(|z|)
(Intercept)   7.9150 0.1049   75.44   2e-16 ***
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Approximate significance of smooth terms:
 edf Est.rank  Chi.sq p-value
s(x0) 5.1739.000  34.067 8.7e-05 ***
s(x1) 2.3579.000 311.679  2e-16 ***
s(x2) 8.5179.000 762.255  2e-16 ***
s(x3) 1.0001.000   0.444   0.505
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

R-sq.(adj) =  0.726   Deviance explained = 73.7%
GCV score =  4.611   Scale est. = 4.4029n = 400

Note that t/F changed into z/Chi.sq.

 
 so as far as i m concerned, i use GCV methods, and fix a 5% on the null
 hypothesis (pvalue) to select significant predictor. after, i look at my
 smooth, and if the parametrization look fine to me, i validate.
 
 generaly, for p-values smaller than 0.001, you can be confident. over
 0.001, you have to check. 
 
 2)
 for difference between package gam and mgcv, i sent a mail about this

The underlying algorithms are very different.


HTH,
Henric

 one year ago, here's the response :
 
 
 - package gam is based very closely on the GAM approach presented in 
 Hastie and Tibshirani's  Generalized Additive Models book. Estimation
 is 
 by back-fitting and model selection is based on step-wise regression 
 methods based on approximate distributional results. A particular
 strength 
 of this approach is that local regression smoothers (`lo()' terms) can
 be 
 included in GAM models.
 
 - gam in package mgcv represents GAMs using penalized regression
 splines. 
 Estimation is by direct penalized likelihood maximization with 
 integrated smoothness estimation via GCV or related criteria (there is 
 also an alternative `gamm' function based on a mixed model approach). 
 Strengths of the this approach are that s() terms can be functions of
 more 
 than one variable and that tensor product smooths are available via te()
 terms - these are useful when different degrees of smoothness are 
 appropriate relative to different arguments of a smooth.
 
 (...)
 
 Basically, if you want integrated smoothness selection, an underlying 
 parametric representation, or want smooth interactions in your models 
 then mgcv is probably worth a try (but I would say that). If you want to
 use local regression smoothers and/or prefer the stepwise selection 
 approach then package gam is for you. 
 
 
 i think the difference of p-values between :gam and :mgcv, is because
 you don't have 

[R] how to fix the level-1 variances in lme()?

2005-09-29 Thread Mike Cheung
Dear all,

Edmond Ng (http://multilevel.ioe.ac.uk/softrev/reviewsplus.pdf) provides 
an example to fit the mixed effects meta-analysis in Splus 6.2. The 
syntax is:
lme(fixed=d~wks, data=meta, random=~1|study, weights=varFixed(~Vofd), 
control=lmeControl(sigma=1))
where d is the effect size, study is the study number, Vofd is the 
variance of the effect size and meta is the data frame.

sigma=1 is required to constrain the level 1 variance in applying 
mixed-effects models in meta-analysis.

In Splus 6.1, I found that the help manual of nlme includes sigma as 
an optional argument in lmeControl() to fix the within-group standard 
error during the optimization.

However, both Pinheiro and Bates (2000, p.476) and the help manual of 
the nlme package in R for Version 3.1-65 
(http://cran.r-project.org/doc/packages/nlme.pdf, p.172) do not include 
sigma as an argument for lmeControl().

I would like to know how I could fix the level-1 variances as known 
values in lme().

Thanks in advance!

Best,
Mike

-- 
-
  Mike W.L. Cheung   Phone: (852) 2857-8621
  Department of Psychology   Fax:   (852) 2858-3518
  The University of Hong KongE-mail: [EMAIL PROTECTED]  
  HONG KONG  Website: http://web.hku.hk/~mikewlch

__
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 fix the level-1 variances in lme()?

2005-09-29 Thread Prof Brian Ripley
On Thu, 29 Sep 2005, Mike Cheung wrote:

 Dear all,

 Edmond Ng (http://multilevel.ioe.ac.uk/softrev/reviewsplus.pdf) provides
 an example to fit the mixed effects meta-analysis in Splus 6.2. The
 syntax is:
 lme(fixed=d~wks, data=meta, random=~1|study, weights=varFixed(~Vofd),
 control=lmeControl(sigma=1))
 where d is the effect size, study is the study number, Vofd is the
 variance of the effect size and meta is the data frame.

 sigma=1 is required to constrain the level 1 variance in applying
 mixed-effects models in meta-analysis.

 In Splus 6.1, I found that the help manual of nlme includes sigma as
 an optional argument in lmeControl() to fix the within-group standard
 error during the optimization.

 However, both Pinheiro and Bates (2000, p.476) and the help manual of
 the nlme package in R for Version 3.1-65
 (http://cran.r-project.org/doc/packages/nlme.pdf, p.172) do not include
 sigma as an argument for lmeControl().

 I would like to know how I could fix the level-1 variances as known
 values in lme().

Use S-PLUS and nlme = 3.3 (as I recall).

R's and S-PLUS's nlme are not the same (they diverged from a common base 
around 1998).  It is a while (2 years?) since I needed this capability, 
but at the time it was not possible in R's lme.

Since you have access to S-PLUS, why not use it?

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

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


Re: [R] is it possible to form matrix of matrices...and multiple arrays

2005-09-29 Thread Prof Brian Ripley

On Thu, 29 Sep 2005 [EMAIL PROTECTED] wrote:


booop booop a écrit :


1...Kindly tell me is it possible to form
a matrix which contains a no of matrices.. for eg..
if a,b,c,d are matrices
and e is a matrix which contains a,b,c,d as rows and columns..


I don't think you can use matrix() to store other matrix() inside.
But array() is a solution to store matrix() inside.
(At least I have use it).


You _can_ do this with matrix() (although that was not quite what was 
asked). Try


a - b - c - d - matrix(1:4, 2, 2)
e - matrix(list(a,b,c,d), 2,2)
e
e[1,2][[1]]

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

2005-09-29 Thread Prof Brian Ripley
On Thu, 29 Sep 2005, Mulholland, Tom wrote:

 Well I downloaded the data using the link in your message which suggests 
 that the code is right. I don't have its loaded (I assume it's from the 
 irregular time series package)

The package is called its, as the message correctly said.

 so I can't test the code as you have it.

chart.yahoo.com is notoriously fickle (as we have seen from the tseries 
example using it).  Note that the first command (which gave me no error) 
also downloaded from there, so this is not going to be an access issue. 
I do get a 404 error on that URL (from two separate ISPs), but not if gdax 
is twice replaced by ftse.

I do think the posting guide makes clear this is an issue for the 
package maintainer, not for R-help.



 Have you tried checking to see it it is an issue with the internet (your 
 browser, blocked sites etc) rather than a problem in R?

 Tom

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] Behalf Of Remigijus
 Lapinskas
 Sent: Thursday, 29 September 2005 12:31 PM
 To: r-help@stat.math.ethz.ch
 Subject: [R] priceIts


 Dear All,

 There is an example for the priceIts function (the its package) which
 does not work for me as expected.

  ?priceIts
   x1 - priceIts(instrument = c(^ftse), start = 1998-01-01,
 +  quote = Close)
 Error in validObject(.Object) : invalid class its object: Missing
 values in dates
   x2 - priceIts(instrument = c(^gdax), start = 1998-01-01,
 +  quote = Close)
 Error in download.file(url, destfile, method = method, quiet
 = quiet) :
  cannot open URL
 'http://chart.yahoo.com/table.csv?s=^gdaxa=0b=01c=1998d=8;
 e=28f=2005g=dq=qy=0z=^gdaxx=.csv'
 In addition: Warning message:
 cannot open: HTTP status was '404 Not Found'
   x - union(x1,x2)
 Error: Object x1 not found
 Error in union(x1, x2) : unable to find the argument 'x' in
 selecting a
 method for function 'union'
   names(x) - c(FTSE,DAX)
   plot(x,lab=TRUE)

 Any help appreciated.

 Best wishes,
 Remigijus

 __
 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


-- 
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] multiple plots on same x axis

2005-09-29 Thread Petr Pikal
Hi

You can use e.g. plot - points construction

plot(Day, gene1)
points(Day, gene2, col=2)

see
?points
?lines

You also need to set appropriate y range by ylim argument to first 
plot. And if you used search facility in CRAN and asked it

multiple plots on same x axis

you would have got many other posibilities for your question.

HTH
Petr



On 27 Sep 2005 at 15:34, IAIN GALLAGHER wrote:

Date sent:  Tue, 27 Sep 2005 15:34:53 +0100 (BST)
From:   IAIN GALLAGHER [EMAIL PROTECTED]
To: r-help@stat.math.ethz.ch
Subject:[R] multiple plots on same x axis

 Hi.
 
 I have two vectors of gene expression for each of
 several days. I want to plot both vectors on the same
 plot for a visual representation of up versus down
 regulation. I've tried using add=T but that doesn't
 work. 
 
 eg
 
 plot(Day, gene1)
 plot(Day, gene2, add=T)
 
 Any help would be appreciated.
 
 Iain
 
 __
 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

Petr Pikal
[EMAIL PROTECTED]

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


Re: [R] is it possible to form matrix of matrices...and multiple arrays

2005-09-29 Thread vincent
Prof Brian Ripley a écrit :

 On Thu, 29 Sep 2005 [EMAIL PROTECTED] wrote:
 I don't think you can use matrix() to store other matrix() inside.
 But array() is a solution to store matrix() inside.
 (At least I have use it).
 
 You _can_ do this with matrix() (although that was not quite what was 
 asked). Try
 a - b - c - d - matrix(1:4, 2, 2)
 e - matrix(list(a,b,c,d), 2,2)

sorry for the wrong answer, and thanks for the correction.
(I certainly do not use list() as much as it should be.)

__
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 fix the level-1 variances in lme()?

2005-09-29 Thread Doran, Harold
Mike

I do not believe this is availabe in either lme or lmer in R, only S-Plus.


-Original Message-
From:   [EMAIL PROTECTED] on behalf of Mike Cheung
Sent:   Thu 9/29/2005 4:32 AM
To: r-help@stat.math.ethz.ch
Cc: 
Subject:[R] how to fix the level-1 variances in lme()?

Dear all,

Edmond Ng (http://multilevel.ioe.ac.uk/softrev/reviewsplus.pdf) provides 
an example to fit the mixed effects meta-analysis in Splus 6.2. The 
syntax is:
lme(fixed=d~wks, data=meta, random=~1|study, weights=varFixed(~Vofd), 
control=lmeControl(sigma=1))
where d is the effect size, study is the study number, Vofd is the 
variance of the effect size and meta is the data frame.

sigma=1 is required to constrain the level 1 variance in applying 
mixed-effects models in meta-analysis.

In Splus 6.1, I found that the help manual of nlme includes sigma as 
an optional argument in lmeControl() to fix the within-group standard 
error during the optimization.

However, both Pinheiro and Bates (2000, p.476) and the help manual of 
the nlme package in R for Version 3.1-65 
(http://cran.r-project.org/doc/packages/nlme.pdf, p.172) do not include 
sigma as an argument for lmeControl().

I would like to know how I could fix the level-1 variances as known 
values in lme().

Thanks in advance!

Best,
Mike

-- 
-
  Mike W.L. Cheung   Phone: (852) 2857-8621
  Department of Psychology   Fax:   (852) 2858-3518
  The University of Hong KongE-mail: [EMAIL PROTECTED]  
  HONG KONG  Website: http://web.hku.hk/~mikewlch

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




[[alternative HTML version deleted]]

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


Re: [R] Plot Data Points in boxplots

2005-09-29 Thread vincent
Martin Maechler a écrit :

 To really thank Paul, you should buy the book to which the above
 web page refers :
   http://www.stat.auckland.ac.nz/~paul/RGraphics/rgraphics.html
 A very nice and useful book to have, indeed!

I just broked my piggy bank for Peter Dalgaard's one,
 so I'll have to wait a bit before it blows out again.

(Peter Dalgaard
Introductory Statistics With R
http://www.amazon.fr/exec/obidos/ASIN/0387954759/qid=1127989069/sr=1-1/ref=sr_1_0_1/171-5704479-0348209
, also very useful as an introduction.)

__
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-level in packages mgcv and gam

2005-09-29 Thread Yves Magliulo
hi,

thanks for reply.

1) sorry for the mistake, (GCV and UBRE estimate df in both case in
deed) i've made a confusion.

2) i use mgcv 1.1-8. (!) so in deed again, i need an update. 

my questions :

3) i can see in the last version of summary.gam an estimated rank: how
do i interpret this?

4) I'm still confusing with this question : should i look at R-sq rather
than Deviance explain, or both? 

5) How can i estimate numericaly the contribution of each smooth
against the others. In others words, is there a way to quantify
significance like a percentage of how the model is improved by each of
my smooth?

6) mgcv : gam and gam : gam  can't be compared. that's 2 distinct
approach of gam, isn't it?

for Denis :

7) to validate the significance of a smooth where p-values is betwwen
0.01 and 0.05, there is no perfect rules...
you have to decide according to your need. look at df, the se of your
smooth, how your model is improved,
if the parametrization look fine according of what you want/know of your
predictor etc... but that's my point of view, maybe someone have
Criterion more precise.

Yves

Le jeu 29/09/2005 à 09:55, Henric Nilsson a écrit :

 Yves Magliulo said the following on 2005-09-28 17:05:
  hi,
  
  i'll try to help you, i send a mail about this subject last week... and
  i did not have any response...
  
  I'm using gam from package mgcv. 
  
  1)
  How to interpret the significance of smooth terms is hard for me to
  understand perfectly : 
  using UBRE, you fix df. p-value are estimated by chi-sq distribution 
  using GCV, the best df are estimated by GAM. (that's what i want) and
  p-values 
 
 This is not correct. The df are  (i.e. UBRE and 
 GCV), but the scale parameter is fixed in the UBRE case. Hence, by 
 default UBRE is used fsignificance of smooth termsor family = binomial or 
 poisson since the scale 
 parameter is assumed to be 1. Similarly, GCV is the default for family = 
 gaussian since we most often want the scale (usually denoted sigma^2) to 
 be estimated.
 
  are estimated by an F distribution But in that case they said use at
  your own risk in ?summary.gam
 
 The warning applies in both cases. The p-values are conditional on the 
 smoothing parameters, and the uncertainty of the smooths is not taken 
 into account when computing the p-values.
 
  so you can also look at the chi.sq : but i don't know how to choose a
 
 No...
 
  criterion like for p-values... for me, chi.sq show the best predictor in
  a model, but it's hard to reject one with it.
 
 Which version of mgcv do you use? The confusion probably stems from 
 earlier versions of mgcv ( 1.3-5): the summary and anova methods used 
 to have a column denoted Chi.sq even when the displayed statistic was 
 computed as F. Recent versions of mgcv has
 
   summary(b)
 
 Family: gaussian
 Link function: identity
 
 Formula:
 y ~ s(x0) + s(x1) + s(x2) + s(x3)
 
 Parametric coefficients:
  Estimate Std. Error t value Pr(|t|)
 (Intercept)   7.9150 0.1049   75.44   2e-16 ***
 ---
 Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
 
 Approximate significance of smooth terms:
  edf Est.rank  F  p-value
 s(x0) 5.1739.000  3.785 0.000137 ***
 s(x1) 2.3579.000 34.631   2e-16 ***
 s(x2) 8.5179.000 84.694   2e-16 ***
 s(x3) 1.0001.000  0.444 0.505797
 ---
 Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
 
 R-sq.(adj) =  0.726   Deviance explained = 73.7%
 GCV score =  4.611   Scale est. = 4.4029n = 400
 
 
 If we assume that the scale is known and fixed at 4.4029, we get
 
   summary(b, dispersion = 4.4029)
 
 Family: gaussian
 Link function: identity
 
 Formula:
 y ~ s(x0) + s(x1) + s(x2) + s(x3)
 
 Parametric coefficients:
  Estimate Std. Error z value Pr(|z|)
 (Intercept)   7.9150 0.1049   75.44   2e-16 ***
 ---
 Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
 
 Approximate significance of smooth terms:
  edf Est.rank  Chi.sq p-value
 s(x0) 5.1739.000  34.067 8.7e-05 ***
 s(x1) 2.3579.000 311.679  2e-16 ***
 s(x2) 8.5179.000 762.255  2e-16 ***
 s(x3) 1.0001.000   0.444   0.505
 ---
 Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
 
 R-sq.(adj) =  0.726   Deviance explained = 73.7%
 GCV score =  4.611   Scale est. = 4.4029n = 400
 
 Note that t/F changed into z/Chi.sq.
 
  
  so as far as i m concerned, i use GCV methods, and fix a 5% on the null
  hypothesis (pvalue) to select significant predictor. after, i look at my
  smooth, and if the parametrization look fine to me, i validate.
  
  generaly, for p-values smaller than 0.001, you can be confident. over
  0.001, you have to check. 
  
  2)
  for difference between package gam and mgcv, i sent a mail about this
 
 The underlying algorithms are very different.
 
 
 HTH,
 Henric
 
  one year ago, here's the response :
  
  
  - package gam is based very closely on the GAM approach presented in 
  Hastie and Tibshirani's  Generalized 

Re: [R] boxplot and xlim confusion?

2005-09-29 Thread Petr Pikal
Hi Karin

I did not have seen any answer for your question yet so here is a 
try.

I gues you want the horizotal layout or your boxplot.

boxplot(split(rnorm(30), rep(1:3, each=10)), horizontal =T, 
names=letters[1:3])

boxplot(split(rnorm(30), rep(1:3, each=10)), horizontal =T, 
names=c(NA,b,NA))

So this is closest what I could dig from your text.

***reproducible*** example would by good starting point what you want 
and was not able to produce.

HTH
Petr




On 28 Sep 2005 at 15:50, Karin Lagesen wrote:

To: [EMAIL PROTECTED]
From:   Karin Lagesen [EMAIL PROTECTED]
Date sent:  Wed, 28 Sep 2005 15:50:06 +0200
Subject:[R] boxplot and xlim confusion?

 
 I have some code as shown below. Basically, I would like three
 boxplots to be set next to each other with no ylabels on the two
 inner plots, and I want the same x axis range on all three. However,
 it seems like boxplot does not respect the xlim setting. I've tried
 the various ways I thought would work (par, boxplot(...xlim=)) but
 none of them seem to work. I then tried plot.window, that did not
 work.
 
 I also have another curious question for you. With the code below I
 tried to call plot.new and then plot.window before each new plot. What
 happens then is that the first figure goes on one page whereas the two
 others get put on the next page with a nice big gap in the middle.
 Does any of you have an explanation for that?
 
 names - c(
 LSU, stop,
 LSU, start,
 SSU, stop,
 SSU, start,
 TSU, stop,
 TSU, start)
 elsustop - read.table(28s.euk.accuracy.stop.dev)
 
 [skipped lots of read.table, which just reads files with one number on
 each line]
 
 par(mfcol=c(1,3))
 par(mai = c(0,0,0.5,0.2), omi = c(1,1,1,1))
 xaxis = c(-6000,1000)
 yaxis = c(0,7)
 #plot.new()
 #plot.window(xlim=xaxis, ylim=yaxis)
 boxplot(alsustop$V1 ,alsustart$V1 ,assustop$V1 ,alsustart$V1
 ,atsustop$V1 ,atsustart$V1
 ,names=names,col=c(lightblue,orange,lightblue,orange,lightblu
 e,orange) ,horizontal = TRUE, main=ARC, xaxs = i, las=1)
 #plot.new() #plot.window(xlim=xaxis, ylim=yaxis) boxplot(blsustop$V1
 ,blsustart$V1 ,bssustop$V1 ,blsustart$V1 ,btsustop$V1 ,btsustart$V1
 ,col=c(lightblue,orange,lightblue,orange,lightblue,orange)
 ,horizontal = TRUE, main=BAC, xaxs = i) #plot.new()
 #plot.window(xlim=xaxis, ylim=yaxis) boxplot(elsustop$V1 ,elsustart$V1
 ,essustop$V1 ,elsustart$V1 ,etsustop$V1 ,etsustart$V1
 ,col=c(lightblue,orange,lightblue,orange,lightblue,orange)
 ,horizontal = TRUE, main=EUK, xaxs = i)
 
 Karin (sorry if you're getting sick of me..:))
 -- 
 Karin Lagesen, PhD student
 [EMAIL PROTECTED]
 http://www.cmbn.no/rognes/
 
 __
 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

Petr Pikal
[EMAIL PROTECTED]

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


Re: [R] Easy cut paste from Excel to R?

2005-09-29 Thread Jose Quesada
Sorry to revive and old topic, but writing to the clipboard seems to
have a problem for me: column names are ignored. Example:

# ~~~
# write.clipboard
# ~~~
write.clipboard = function(obj) {
write.table(obj, file(clipboard), sep=\t, row.names=F, col.names=T)
}

a= matrix(1:4,2,2)
colnames(a) = c(a, b)

write.clipboard(a)
a = as.data.frame(a)
write.clipboard(a)

both attempts will paste the date without column names.
Any idea why?

Thanks,
-Jose

On 2/16/05, Werner Wernersen [EMAIL PROTECTED] wrote:
 Thank you all very much for the answers!
 The read.table / read.delim2 commands are exactly what
 I was looking for to get
 a couple of numbers or a little matrix quickly into R
 without creating an extra
 text file every time.

 And it works the other way around as well:
 write.table(x, file(clipboard), sep=\t)
 Fantastic!

 Thanks again,
Werner

 Nick Drew wrote:
  I've had good luck with the scan() function when I
  want to get a few numbers from Excel into R quickly
 to
  use it as a calculator. CAVEAT: you have to have the
  numbers you want to copy in a column not a row in
  Excel. For example:
 
  In Excel your data are in a column as follows:
  Col A
  1
  2
  3
 
  Then copy the 3 cells (e.g. 1, 2,3) in Excel and
 open
  R and type in:
 
 data - scan()
 
 
  Then Paste using Ctrl-V. Hit the Enter key. You know
  have an object called data that you can use and
  manipulate in R.
 
  I've taken this even further by creating an R
 function
  that will take a column of numbers from Excel and
 then
  scan() them into R, create a matrix, and then
 perform
  a Chi-square test. Let me know if you'd like to know
  more. I'm a beginner and if I can do so can you!!
 
  ~Nick
 
 
 
  
  __
  Do you Yahoo!?


  http://promotions.yahoo.com/new_mail
 
 

 __
 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



--
Jose Quesada, PhD.

[EMAIL PROTECTED]   ESRC Postdoctoral Fellow
http://lsa.colorado.edu/~quesadaj   Dept. of PSychology
http://www.andrew.cmu.edu/~jquesada University of Warwick
office H114 Phone: +44 024 765 23 
759
Coventry, UK

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


[R] Regression slope confidence interval

2005-09-29 Thread Christian Hennig
Hi list,

is there any direct way to obtain confidence intervals for the regression
slope from lm, predict.lm or the like?
(If not, is there any reason? This is also missing in some other statistics
softwares, and I thought this would be quite a standard application.)
I know that it's easy to implement but it's for
explanation to people who faint if they have to do their own
programming...

Christian

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

__
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] Regression slope confidence interval

2005-09-29 Thread Chuck Cleland
?confint

For example:

  ctl - c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.33,5.14)
   trt - c(4.81,4.17,4.41,3.59,5.87,3.83,6.03,4.89,4.32,4.69)
   group - gl(2,10,20, labels=c(Ctl,Trt))
   weight - c(ctl, trt)
  lm(weight ~ group)

Call:
lm(formula = weight ~ group)

Coefficients:
(Intercept) groupTrt
   5.032   -0.371

  confint(lm(weight ~ group))
 2.5 %97.5 %
(Intercept)  4.569340 5.4946602
groupTrt-1.025300 0.2833003

Christian Hennig wrote:
 Hi list,
 
 is there any direct way to obtain confidence intervals for the regression
 slope from lm, predict.lm or the like?
 (If not, is there any reason? This is also missing in some other statistics
 softwares, and I thought this would be quite a standard application.)
 I know that it's easy to implement but it's for
 explanation to people who faint if they have to do their own
 programming...
 
 Christian
 
 *** --- ***
 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
 
 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
 

-- 
Chuck Cleland, Ph.D.
NDRI, Inc.
71 West 23rd Street, 8th floor
New York, NY 10010
tel: (212) 845-4495 (Tu, Th)
tel: (732) 452-1424 (M, W, F)
fax: (917) 438-0894

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


Re: [R] Regression slope confidence interval

2005-09-29 Thread Søren Højsgaard
?confint


 

 -Oprindelig meddelelse-
 Fra: [EMAIL PROTECTED] 
 [mailto:[EMAIL PROTECTED] På vegne af Christian Hennig
 Sendt: 29. september 2005 13:19
 Til: r-help-request Mailing List
 Emne: [R] Regression slope confidence interval
 
 Hi list,
 
 is there any direct way to obtain confidence intervals for 
 the regression slope from lm, predict.lm or the like?
 (If not, is there any reason? This is also missing in some 
 other statistics softwares, and I thought this would be quite 
 a standard application.) I know that it's easy to implement 
 but it's for explanation to people who faint if they have to 
 do their own programming...
 
 Christian
 
 *** --- ***
 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
 
 __
 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] Regression slope confidence interval

2005-09-29 Thread Achim Zeileis
On Thu, 29 Sep 2005, Christian Hennig wrote:

 Hi list,

 is there any direct way to obtain confidence intervals for the regression
 slope from lm, predict.lm or the like?

There is a confint method: e.g.,

R fm - lm(dist ~ speed, data = cars)
R confint(fm, parm = speed)
 2.5 %   97.5 %
speed 3.096964 4.767853

hth,
Z

 (If not, is there any reason? This is also missing in some other statistics
 softwares, and I thought this would be quite a standard application.)
 I know that it's easy to implement but it's for
 explanation to people who faint if they have to do their own
 programming...

 Christian

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

 __
 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] Regression slope confidence interval

2005-09-29 Thread Christian Hennig
 ?confint


Thank you to all of you.

As far as I see this is not mentioned on the lm help page (though I
presumably don't have the recent version), which I would
suggest...

Best,
Christian

On Thu, 29 Sep 2005, Chuck Cleland wrote:

 ?confint

 For example:

   ctl - c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.33,5.14)
trt - c(4.81,4.17,4.41,3.59,5.87,3.83,6.03,4.89,4.32,4.69)
group - gl(2,10,20, labels=c(Ctl,Trt))
weight - c(ctl, trt)
   lm(weight ~ group)

 Call:
 lm(formula = weight ~ group)

 Coefficients:
 (Intercept) groupTrt
5.032   -0.371

   confint(lm(weight ~ group))
  2.5 %97.5 %
 (Intercept)  4.569340 5.4946602
 groupTrt-1.025300 0.2833003

 Christian Hennig wrote:
  Hi list,
 
  is there any direct way to obtain confidence intervals for the regression
  slope from lm, predict.lm or the like?
  (If not, is there any reason? This is also missing in some other statistics
  softwares, and I thought this would be quite a standard application.)
  I know that it's easy to implement but it's for
  explanation to people who faint if they have to do their own
  programming...
 
  Christian
 
  *** --- ***
  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
 
  __
  R-help@stat.math.ethz.ch mailing list
  https://stat.ethz.ch/mailman/listinfo/r-help
  PLEASE do read the posting guide! 
  http://www.R-project.org/posting-guide.html
 

 --
 Chuck Cleland, Ph.D.
 NDRI, Inc.
 71 West 23rd Street, 8th floor
 New York, NY 10010
 tel: (212) 845-4495 (Tu, Th)
 tel: (732) 452-1424 (M, W, F)
 fax: (917) 438-0894


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

__
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] Problem with memory footprint of qq plot generated with lattice

2005-09-29 Thread Witold Eryk Wolski

Dave,

qqmath(~val|ind,data=xx
   ,distribution=function(p) qt(p,df=19)
   ,ylab=Sample Quatinles
   ,xlab=Theoretical Quantiles
   ,aspect=1
   ,prepanel = prepanel.qqmathline
   ,panel=function(x,y)
   {
 panel.qqmathline(y, distribution=function(p) qt(p,df=19),col=2)
 panel.qqmath(x, y , distribution=function(p)
qt(p,df=19),pch=.,cex=2)
   }
)

Adding f.value=fn as argument to qqmath reduces the size of the image, 
but neither the axis (absicissae) nor the line added by panel.qqmathline 
are right.


Adding f.value=fn as argument to panel.qqmathline and panel.qqmath 
generates the right graphic, but the size of the image is again 20 MB.


Any Suggestions?

Eryk

[EMAIL PROTECTED] wrote:

nwew [EMAIL PROTECTED] wrote:


Dear R helpers,




I generate a qq plot using the following function call.



...



dim(xx)
[1] 680237  2



How about doing something like this:

fn - function(n,cut=0.001,m=1000)
{
p - ppoints(n)
p - p[pmin(p, 1-p)  cut]
q - pt(seq(qt(cut,df=19),qt(1-cut,df=19),length=m),df=19)
sort(c(p,q))
}

then adding 'f.value=fn' to your qqmath arguments?  This essentially
says, plot the individual data points in the extreme tails of the
distribution (p  0.001 or p  0.999), and evaluate the distribution
at a sparse set of points in between, where the density means you
can't discern the individual values anyway.

-- Dave

__
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] Regression slope confidence interval

2005-09-29 Thread Renaud Lancelot
Why not use vcov() and the normal approximation ?

  ctl - c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.33,5.14)
  trt - c(4.81,4.17,4.41,3.59,5.87,3.83,6.03,4.89,4.32,4.69)
  group - gl(2,10,20, labels=c(Ctl,Trt))
  weight - c(ctl, trt)
  lm.D9 - lm(weight ~ group)
 
  cbind(estimate = coef(lm.D9),
+   lower = coef(lm.D9) - 1.96 * diag(vcov(lm.D9)),
+   upper = coef(lm.D9) + 1.96 * diag(vcov(lm.D9)))
 estimate  lower  upper
(Intercept)5.032  4.9369482  5.1270518
groupTrt  -0.371 -0.5611037 -0.1808963

To address your needs, it might also be possible to write a method for 
the generic of intervals() in package nlme.

Best,

Renaud

Christian Hennig a écrit :
 Hi list,
 
 is there any direct way to obtain confidence intervals for the regression
 slope from lm, predict.lm or the like?
 (If not, is there any reason? This is also missing in some other statistics
 softwares, and I thought this would be quite a standard application.)
 I know that it's easy to implement but it's for
 explanation to people who faint if they have to do their own
 programming...
 
 Christian
 
 *** --- ***
 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
 
 __
 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
 

-- 
Renaud Lancelot
Directeur Adjoint chargé des Affaires Scientifiques
Deputy Director for Scientific Affairs

Département EMVT du CIRAD, TA 30/B
Campus International de Baillarguet
34398 Montpellier Cedex 5 - France
Tel.  +33 (0)4 67 59 37 17
Secr. +33 (0)4 67 59 39 04
Fax   +33 (0)4 67 59 37 95

__
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] Regression slope confidence interval

2005-09-29 Thread Renaud Lancelot
Sorry, I forgot confint and I made a mistake in my suggestion which 
should be:

cbind(estimate = coef(lm.D9),
   lower = coef(lm.D9) - 1.96 * sqrt(diag(vcov(lm.D9))),
   upper = coef(lm.D9) + 1.96 * sqrt(diag(vcov(lm.D9

Best,

Renaud

Christian Hennig a écrit :
 Hi list,
 
 is there any direct way to obtain confidence intervals for the regression
 slope from lm, predict.lm or the like?
 (If not, is there any reason? This is also missing in some other statistics
 softwares, and I thought this would be quite a standard application.)
 I know that it's easy to implement but it's for
 explanation to people who faint if they have to do their own
 programming...
 
 Christian
 
 *** --- ***
 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
 
 __
 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
 

-- 
Renaud Lancelot
Directeur Adjoint chargé des Affaires Scientifiques
Deputy Director for Scientific Affairs

Département EMVT du CIRAD, TA 30/B
Campus International de Baillarguet
34398 Montpellier Cedex 5 - France
Tel.  +33 (0)4 67 59 37 17
Secr. +33 (0)4 67 59 39 04
Fax   +33 (0)4 67 59 37 95

__
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] memory issues with large data set

2005-09-29 Thread roger bos
memory.limit may not be the correct command. I use the command 'utils::
memory.size(3*1024)' to increase my memory size after using editbin to
modify the header of R to make it LARGEADDRESSAWARE as described in the
above FAQ. I am able to read about 2.7Gb into memory that way with 4Gb of
ram. Not only am I able to read it into memory, but I can do regessions on
subsets of the data no problem.
 My question has always been, why can't R ship LARGEADDRESSAWARE for those
users who may not have access to 'editbin' type tools?
 Thanks,
 Roger


 On 9/28/05, Christina Yau [EMAIL PROTECTED] wrote:

 Hi,

 I am running R 2.0.1.1 http://2.0.1.1. on Windows. It is a Dell
 Dimension with a 3.2 Ghz Processor and 4Gb RAM.

 When using the ReadAffy() function to read in 97 arrays, I get the below
 error messages:
 Error: cannot allocate vector of size 393529
 Reached total allocation of 1024Mb: see help(memory.size)

 When I use the comman memory.limit(size=4000) to increase the memory
 size to the maximum available, I got a NULL as a response.

 I proceeded to re-run ReadAffy(). This time, I only get the first error
 message.
 Error: cannot allocate vector of size 393529

 From what I've read, this is more of a problem with Windows than with R.
 But I am wondering if there is anything I can do, either with the set up of
 R or Windows, to solve this problem and read the data set into R using this
 machine.

 Thank you for your attention,
 Christina

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


[[alternative HTML version deleted]]

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


Re: [R] anova on binomial LMER objects

2005-09-29 Thread Alan Cobo-Lewis
On Wed, 28 Sep 2005, Robert Bagchi wrote:
Hi Patrick

thanks for your advice. I have now tried glmmPQL, and it worked fine - 
I'm getting consistent results between plots and models fitted by 
glmmPQL. Plus it allows predict() and resid() which is another advantage 
over lmer at present.

quick question though: why does one need to use PQL for binomial models? 
Is there a good reference for this?

You don't have to use PQL for binomial models, but you can't use least-squares. 
PQL is an approximate solution. Laplace and Adaptive Gaussian Quadrature 
options in lmer are better approximations. So lmer would likely become the 
better option as it
progresses in its development (though the current issues you've found with the 
F ratios certainly sound like maybe lmer isn't better for you in its current 
incarnation).
alan

--
Alan B. Cobo-Lewis, Ph.D.   (207) 581-3840 tel
Department of Psychology(207) 581-6128 fax
University of Maine
Orono, ME 04469-5742[EMAIL PROTECTED]

http://www.umaine.edu/visualperception

__
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] Easy cut paste from Excel to R?

2005-09-29 Thread Gabor Grothendieck
See:

http://finzi.psych.upenn.edu/R/Rhelp02a/archive/26922.html

On 9/29/05, Jose Quesada [EMAIL PROTECTED] wrote:
 Sorry to revive and old topic, but writing to the clipboard seems to
 have a problem for me: column names are ignored. Example:

 # ~~~
 # write.clipboard
 # ~~~
 write.clipboard = function(obj) {
write.table(obj, file(clipboard), sep=\t, row.names=F, col.names=T)
 }

 a= matrix(1:4,2,2)
 colnames(a) = c(a, b)

 write.clipboard(a)
 a = as.data.frame(a)
 write.clipboard(a)

 both attempts will paste the date without column names.
 Any idea why?

 Thanks,
 -Jose

 On 2/16/05, Werner Wernersen [EMAIL PROTECTED] wrote:
  Thank you all very much for the answers!
  The read.table / read.delim2 commands are exactly what
  I was looking for to get
  a couple of numbers or a little matrix quickly into R
  without creating an extra
  text file every time.
 
  And it works the other way around as well:
  write.table(x, file(clipboard), sep=\t)
  Fantastic!
 
  Thanks again,
 Werner
 
  Nick Drew wrote:
   I've had good luck with the scan() function when I
   want to get a few numbers from Excel into R quickly
  to
   use it as a calculator. CAVEAT: you have to have the
   numbers you want to copy in a column not a row in
   Excel. For example:
  
   In Excel your data are in a column as follows:
   Col A
   1
   2
   3
  
   Then copy the 3 cells (e.g. 1, 2,3) in Excel and
  open
   R and type in:
  
  data - scan()
  
  
   Then Paste using Ctrl-V. Hit the Enter key. You know
   have an object called data that you can use and
   manipulate in R.
  
   I've taken this even further by creating an R
  function
   that will take a column of numbers from Excel and
  then
   scan() them into R, create a matrix, and then
  perform
   a Chi-square test. Let me know if you'd like to know
   more. I'm a beginner and if I can do so can you!!
  
   ~Nick
  
  
  
  
   __
   Do you Yahoo!?
 
 
   http://promotions.yahoo.com/new_mail
  
  
 
  __
  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
 


 --
 Jose Quesada, PhD.

 [EMAIL PROTECTED] ESRC Postdoctoral Fellow
 http://lsa.colorado.edu/~quesadaj   Dept. of PSychology
 http://www.andrew.cmu.edu/~jquesada University of Warwick
 office H114 Phone: +44 024 765 23 
 759
 Coventry, UK

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


__
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] standard error of variances and covariances of the random effects with LME

2005-09-29 Thread Roel de Jong
Hello,

how do I obtain standard errors of variances and covariances of the 
random effects with LME comparable to those of for example MlWin? I know 
you shouldn't use them because the distribution of the estimator isn't 
symmetric blablabla, but I need a measure of the variance of those 
estimates for pooling my multiple imputation results.

Regards,
   Roel.

__
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] reshaping data?

2005-09-29 Thread Karin Lagesen

I have a file like this:


a   0.1
a   0.2
a   0.9
b   0.5
b   0.9
b   0.7
c   0.6
c   0.99
c   0.88

Which I would like to get to be the following matrix:

  0.1 0.20.30.4  ...  
a 12 0   0 
b 00 0   0 
..

I.e: each place in the matrix denotes how many entries in each
category that are betwee 0.0 and 0.1, 0.1 and 0.2 and so on.

The way I was thinking of doing it was by constructing an empty matrix
and then doing a for loop testing each element and incrementing in the
matrix as appropriate. However, it struck me that this has to be
easier to do than that. Am I right?

Karin
-- 
Karin Lagesen, PhD student
[EMAIL PROTECTED]
http://www.cmbn.no/rognes/

__
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] standard error of variances and covariances of the random effects with LME

2005-09-29 Thread Doran, Harold
You cannot. Also, it's not that the distribution of the random effects
is not symmetric, but that it *may* not be symmetric, and this is an
assumption that should be checked. 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Roel de Jong
Sent: Thursday, September 29, 2005 9:20 AM
To: r-help@stat.math.ethz.ch
Subject: [R] standard error of variances and covariances of the random
effects with LME

Hello,

how do I obtain standard errors of variances and covariances of the
random effects with LME comparable to those of for example MlWin? I know
you shouldn't use them because the distribution of the estimator isn't
symmetric blablabla, but I need a measure of the variance of those
estimates for pooling my multiple imputation results.

Regards,
   Roel.

__
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] boxplot and xlim confusion?

2005-09-29 Thread Karin Lagesen
Petr Pikal [EMAIL PROTECTED] writes:

 Hi Karin

 I did not have seen any answer for your question yet so here is a 
 try.

 I gues you want the horizotal layout or your boxplot.

 boxplot(split(rnorm(30), rep(1:3, each=10)), horizontal =T, 
 names=letters[1:3])

 boxplot(split(rnorm(30), rep(1:3, each=10)), horizontal =T, 
 names=c(NA,b,NA))

These look like the plots I want, yes. However, is there a way of
locking the x-axis? When I do these several times in a row, the range
of the x axis moves with the data being plotted. If I set xlim in the
boxplot command, it makes no difference what so ever.


 So this is closest what I could dig from your text.

 ***reproducible*** example would by good starting point what you want 
 and was not able to produce.

Sorry about that...:)

Karin
-- 
Karin Lagesen, PhD student
[EMAIL PROTECTED]
http://www.cmbn.no/rognes/

__
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] reshaping data?

2005-09-29 Thread Dimitris Rizopoulos
you could use something like this (but maybe there are better 
proposals):

dat - data.frame(g = rep(letters[1:3], each = 5), val = runif(15))

out - do.call(rbind, lapply(split(dat$val, dat$g), function(x){
f - factor(findInterval(x, vec = seq(0, 1, 0.1)), levels = 1:10)
table(f)
}))
colnames(out) - seq(0.1, 1, 0.1)
out


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/(0)16/336899
Fax: +32/(0)16/337015
Web: http://www.med.kuleuven.be/biostat/
 http://www.student.kuleuven.be/~m0390867/dimitris.htm


- Original Message - 
From: Karin Lagesen [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, September 29, 2005 3:16 PM
Subject: [R] reshaping data?



 I have a file like this:


 a   0.1
 a   0.2
 a   0.9
 b   0.5
 b   0.9
 b   0.7
 c   0.6
 c   0.99
 c   0.88

 Which I would like to get to be the following matrix:

  0.1 0.20.30.4  ...
 a 12 0   0
 b 00 0   0
 ..

 I.e: each place in the matrix denotes how many entries in each
 category that are betwee 0.0 and 0.1, 0.1 and 0.2 and so on.

 The way I was thinking of doing it was by constructing an empty 
 matrix
 and then doing a for loop testing each element and incrementing in 
 the
 matrix as appropriate. However, it struck me that this has to be
 easier to do than that. Am I right?

 Karin
 -- 
 Karin Lagesen, PhD student
 [EMAIL PROTECTED]
 http://www.cmbn.no/rognes/

 __
 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
 


Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm

__
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] reshaping data?

2005-09-29 Thread Thomas Lumley
On Thu, 29 Sep 2005, Karin Lagesen wrote:


 I have a file like this:


 a   0.1
 a   0.2
 a   0.9
 b   0.5
 b   0.9
 b   0.7
 c   0.6
 c   0.99
 c   0.88

 Which I would like to get to be the following matrix:

  0.1 0.20.30.4  ...
 a 12 0   0
 b 00 0   0
 ..

 I.e: each place in the matrix denotes how many entries in each
 category that are betwee 0.0 and 0.1, 0.1 and 0.2 and so on.


If your variables are called, say, id and value, and value is between 0 
and 1 then

table(id,cut(value,breaks=(0:10)/10))

works.

-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


[R] New family for gam in the mgcv library

2005-09-29 Thread Eva Cantoni
Hi!

I'm using R 2.0.1 on a Sun, with mgcv library version 1.3-1.

I would like to implement a new family for the function gam in mgcv 
(truncated Poisson family as defined in Barry  Welsh (2002), Ecological 
Modelling).

I therefore defined a family function with all the necessary components 
(linkfun, linkinv, variance, etc). But then I run into problems because 
my link function is not a standard one, and fix.family.link() and 
fix.family.var() (called by gam.outer) won't work. As I understand, the 
purpose of these two functions is to modify families so to add a dvar 
component and a d2link component, necessary for the fitting.

The fix I can imagine (but I didn't try yet) is to add the two extra 
components (dvar and d2link) when defining the new family, and to 
redefine the function gam.outer to avoid the use of fix.family.*.

Does someone have experience with this? Would this be the end of my 
troubles?

Thank you for your help,
Eva Cantoni




-- 

  Dr Eva Cantoni phone  : (+41) 22 379 8240
  Econométrie - Univ. Genève fax: (+41) 22 379 8299
  40, Bd du Pont d'Arve  e-mail : [EMAIL PROTECTED]
  CH-1211 Genève 4   http://www.unige.ch/ses/metri/cantoni

__
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] reshaping data?

2005-09-29 Thread Gabor Grothendieck
This can be shortened slightly using cut:

table(data.frame(g = dat$g, val = cut(dat$val, 0:10/10, lab = 1:10/10)))

On 9/29/05, Dimitris Rizopoulos [EMAIL PROTECTED] wrote:
 you could use something like this (but maybe there are better
 proposals):

 dat - data.frame(g = rep(letters[1:3], each = 5), val = runif(15))

 out - do.call(rbind, lapply(split(dat$val, dat$g), function(x){
f - factor(findInterval(x, vec = seq(0, 1, 0.1)), levels = 1:10)
table(f)
}))
 colnames(out) - seq(0.1, 1, 0.1)
 out


 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/(0)16/336899
 Fax: +32/(0)16/337015
 Web: http://www.med.kuleuven.be/biostat/
 http://www.student.kuleuven.be/~m0390867/dimitris.htm


 - Original Message -
 From: Karin Lagesen [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Thursday, September 29, 2005 3:16 PM
 Subject: [R] reshaping data?


 
  I have a file like this:
 
 
  a   0.1
  a   0.2
  a   0.9
  b   0.5
  b   0.9
  b   0.7
  c   0.6
  c   0.99
  c   0.88
 
  Which I would like to get to be the following matrix:
 
   0.1 0.20.30.4  ...
  a 12 0   0
  b 00 0   0
  ..
 
  I.e: each place in the matrix denotes how many entries in each
  category that are betwee 0.0 and 0.1, 0.1 and 0.2 and so on.
 
  The way I was thinking of doing it was by constructing an empty
  matrix
  and then doing a for loop testing each element and incrementing in
  the
  matrix as appropriate. However, it struck me that this has to be
  easier to do than that. Am I right?
 
  Karin
  --
  Karin Lagesen, PhD student
  [EMAIL PROTECTED]
  http://www.cmbn.no/rognes/
 
  __
  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
 


 Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm

 __
 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] reshaping data?

2005-09-29 Thread Gabor Grothendieck
And slightly more to:

table(g = dat$g, val = cut(dat$val, 0:10/10, lab = 1:10/10))

On 9/29/05, Gabor Grothendieck [EMAIL PROTECTED] wrote:
 This can be shortened slightly using cut:

 table(data.frame(g = dat$g, val = cut(dat$val, 0:10/10, lab = 1:10/10)))

 On 9/29/05, Dimitris Rizopoulos [EMAIL PROTECTED] wrote:
  you could use something like this (but maybe there are better
  proposals):
 
  dat - data.frame(g = rep(letters[1:3], each = 5), val = runif(15))
 
  out - do.call(rbind, lapply(split(dat$val, dat$g), function(x){
 f - factor(findInterval(x, vec = seq(0, 1, 0.1)), levels = 1:10)
 table(f)
 }))
  colnames(out) - seq(0.1, 1, 0.1)
  out
 
 
  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/(0)16/336899
  Fax: +32/(0)16/337015
  Web: http://www.med.kuleuven.be/biostat/
  http://www.student.kuleuven.be/~m0390867/dimitris.htm
 
 
  - Original Message -
  From: Karin Lagesen [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: Thursday, September 29, 2005 3:16 PM
  Subject: [R] reshaping data?
 
 
  
   I have a file like this:
  
  
   a   0.1
   a   0.2
   a   0.9
   b   0.5
   b   0.9
   b   0.7
   c   0.6
   c   0.99
   c   0.88
  
   Which I would like to get to be the following matrix:
  
0.1 0.20.30.4  ...
   a 12 0   0
   b 00 0   0
   ..
  
   I.e: each place in the matrix denotes how many entries in each
   category that are betwee 0.0 and 0.1, 0.1 and 0.2 and so on.
  
   The way I was thinking of doing it was by constructing an empty
   matrix
   and then doing a for loop testing each element and incrementing in
   the
   matrix as appropriate. However, it struck me that this has to be
   easier to do than that. Am I right?
  
   Karin
   --
   Karin Lagesen, PhD student
   [EMAIL PROTECTED]
   http://www.cmbn.no/rognes/
  
   __
   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
  
 
 
  Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm
 
  __
  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] boxplot and xlim confusion?

2005-09-29 Thread Marc Schwartz (via MN)
On Thu, 2005-09-29 at 15:28 +0200, Karin Lagesen wrote:
 Petr Pikal [EMAIL PROTECTED] writes:
 
  Hi Karin
 
  I did not have seen any answer for your question yet so here is a 
  try.
 
  I gues you want the horizotal layout or your boxplot.
 
  boxplot(split(rnorm(30), rep(1:3, each=10)), horizontal =T, 
  names=letters[1:3])
 
  boxplot(split(rnorm(30), rep(1:3, each=10)), horizontal =T, 
  names=c(NA,b,NA))
 
 These look like the plots I want, yes. However, is there a way of
 locking the x-axis? When I do these several times in a row, the range
 of the x axis moves with the data being plotted. If I set xlim in the
 boxplot command, it makes no difference what so ever.

That's because when you use 'horizontal = TRUE' in boxplot(), the x and
y axes are rotated. Thus you need to set 'ylim' and not 'xlim', where
ylim is the range of values in your data irrespective of the axis
orientation.

This is done in bxp(), which is the actual function doing the plotting
for boxplot(). In bxp(), there is the follow code snippet:

if (horizontal) 
plot.window(ylim = c(0.5, n + 0.5), xlim = ylim, 
log = log)
else plot.window(xlim = c(0.5, n + 0.5), ylim = ylim, 
 log = log)

Note in the first case, that the xlim value for plot.window() is set to
the ylim value passed from boxplot() or from bxp(), if called directly.

So, the above examples by Petr should be something like:

boxplot(split(rnorm(30), rep(1:3, each=10)), horizontal = TRUE, 
names=letters[1:3], ylim = c(-4, 4))

boxplot(split(rnorm(30), rep(1:3, each=10)), horizontal =TRUE, 
names=c(NA,b,NA), ylim = c(-4, 4))


HTH,

Marc Schwartz

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


[R] R-2.1.1 on AIX 5.*

2005-09-29 Thread Raphael Bolze
Hi,

I need to install R-2.1.1 on a AIX machine. (i have tried several machine with 
different os version : 5.1, 5.2 and 5.3)
I have tried several configuration which was advise on the R-install and admin 
section :
but none goes to the end of compilation.

my configure command line is :
#./configure --prefix=$HOME/local/R-2.1.1 CC=xlc_r CXX=xlC_r F77=xlf_r 
--without-x --without-readline OBJECT_MODE=64 LDFLAGS=-brtl CFLAGS=-O 
-qstrict FFLAGS=-O -qstrict CXXFLAGS=-O -qstrict 

then i compiled the source :
#make
and i have the following error.
making vsnprintf.d from vsnprintf.c
xlc_r -I../../src/extra/zlib -I../../src/extra/bzip2 
-I../../src/extra/pcre   -I. -I../../src/include -I../../src/include 
-I/usr/local/include -DHAVE_CONFIG_H   -O -qstrict -c Rmain.c -o Rmain.o
xlc_r -I../../src/extra/zlib -I../../src/extra/bzip2 
-I../../src/extra/pcre   -I. -I../../src/include -I../../src/include 
-I/usr/local/include -DHAVE_CONFIG_H   -O -qstrict -c CConverters.c -o 
CConverters.o
xlc_r -I../../src/extra/zlib -I../../src/extra/bzip2 
-I../../src/extra/pcre   -I. -I../../src/include -I../../src/include 
-I/usr/local/include -DHAVE_CONFIG_H   -O -qstrict -c CommandLineArgs.c -o 
CommandLin
eArgs.o
CommandLineArgs.c, line 170.32: 1506-1298 (W) The subscript 31 is out of 
range. The valid range is 0 to 30.
xlc_r -I../../src/extra/zlib -I../../src/extra/bzip2 
-I../../src/extra/pcre   -I. -I../../src/include -I../../src/include 
-I/usr/local/include -DHAVE_CONFIG_H   -O -qstrict -c Rdynload.c -o 
Rdynload.o
xlc_r -I../../src/extra/zlib -I../../src/extra/bzip2 
-I../../src/extra/pcre   -I. -I../../src/include -I../../src/include 
-I/usr/local/include -DHAVE_CONFIG_H   -O -qstrict -c Renviron.c -o 
Renviron.o
xlc_r -I../../src/extra/zlib -I../../src/extra/bzip2 
-I../../src/extra/pcre   -I. -I../../src/include -I../../src/include 
-I/usr/local/include -DHAVE_CONFIG_H   -O -qstrict -c RNG.c -o RNG.o
xlc_r -I../../src/extra/zlib -I../../src/extra/bzip2 
-I../../src/extra/pcre   -I. -I../../src/include -I../../src/include 
-I/usr/local/include -DHAVE_CONFIG_H   -O -qstrict -c apply.c -o apply.o
xlc_r -I../../src/extra/zlib -I../../src/extra/bzip2 
-I../../src/extra/pcre   -I. -I../../src/include -I../../src/include 
-I/usr/local/include -DHAVE_CONFIG_H   -O -qstrict -c arithmetic.c -o 
arithmetic.o
xlc_r -I../../src/extra/zlib -I../../src/extra/bzip2 
-I../../src/extra/pcre   -I. -I../../src/include -I../../src/include 
-I/usr/local/include -DHAVE_CONFIG_H   -O -qstrict -c apse.c -o apse.o
xlc_r -I../../src/extra/zlib -I../../src/extra/bzip2 
-I../../src/extra/pcre   -I. -I../../src/include -I../../src/include 
-I/usr/local/include -DHAVE_CONFIG_H   -O -qstrict -c array.c -o array.o
xlc_r -I../../src/extra/zlib -I../../src/extra/bzip2 
-I../../src/extra/pcre   -I. -I../../src/include -I../../src/include 
-I/usr/local/include -DHAVE_CONFIG_H   -O -qstrict -c attrib.c -o attrib.o
xlc_r -I../../src/extra/zlib -I../../src/extra/bzip2 
-I../../src/extra/pcre   -I. -I../../src/include -I../../src/include 
-I/usr/local/include -DHAVE_CONFIG_H   -O -qstrict -c base.c -o base.o
xlc_r -I../../src/extra/zlib -I../../src/extra/bzip2 
-I../../src/extra/pcre   -I. -I../../src/include -I../../src/include 
-I/usr/local/include -DHAVE_CONFIG_H   -O -qstrict -c bind.c -o bind.o
xlc_r -I../../src/extra/zlib -I../../src/extra/bzip2 
-I../../src/extra/pcre   -I. -I../../src/include -I../../src/include 
-I/usr/local/include -DHAVE_CONFIG_H   -O -qstrict -c builtin.c -o builtin.o
xlc_r -I../../src/extra/zlib -I../../src/extra/bzip2 
-I../../src/extra/pcre   -I. -I../../src/include -I../../src/include 
-I/usr/local/include -DHAVE_CONFIG_H   -O -qstrict -c character.c -o 
character.o
xlc_r -I../../src/extra/zlib -I../../src/extra/bzip2 
-I../../src/extra/pcre   -I. -I../../src/include -I../../src/include 
-I/usr/local/include -DHAVE_CONFIG_H   -O -qstrict -c coerce.c -o coerce.o
xlc_r -I../../src/extra/zlib -I../../src/extra/bzip2 
-I../../src/extra/pcre   -I. -I../../src/include -I../../src/include 
-I/usr/local/include -DHAVE_CONFIG_H   -O -qstrict -c colors.c -o colors.o
xlc_r -I../../src/extra/zlib -I../../src/extra/bzip2 
-I../../src/extra/pcre   -I. -I../../src/include -I../../src/include 
-I/usr/local/include -DHAVE_CONFIG_H   -O -qstrict -c complex.c -o complex.o
xlc_r -I../../src/extra/zlib -I../../src/extra/bzip2 
-I../../src/extra/pcre   -I. -I../../src/include -I../../src/include 
-I/usr/local/include -DHAVE_CONFIG_H   -O -qstrict -c connections.c -o 
connections.o
connections.c, line 2580.18: 1506-052 (S) Duplicate case label for value 4. 
Labels must be unique.
connections.c, line 2598.18: 1506-052 (S) Duplicate case label for value 4. 
Labels must be unique.
connections.c, line 2757.18: 1506-052 (S) Duplicate case label for value 4. 
Labels must be unique.
connections.c, line 

[R] Repeated measure Generalized Linear Mixed Model (glmm) ?

2005-09-29 Thread Jérôme Lemaître
Dear all,

I want to know the probability of dying in a trap as a function of habitat
variables for a metapopulation of voles sampled in 44 stations. 
My dataset is as follow:
Station tag number  deadhabitat1habitat2
1   1   yes 20  26
1   2   no  20  26
2   3   no  15  16
..

As far as I know, I should use a mixed-model as:
glmmPQL-(fixed = dead~habitat1+habitat2, random = ~1|station, family =
binomial) in the MASS library.
However, some vole individuals were recaptured (but it is not a study
designed for capture-mark-recapture!!!) therefore, I have for example, the
4th vole:
Station tag number  deadhabitat1habitat2
3   4   no  10  12
3   4   yes 10  12

Someone suggested me to use glmm with repeated measures with the number of
tag as the variable to repeat. Apparently, it is possible to do this in SAS.

QUESTIONS : 
1) Is this also possible to do this in R, and if yes, could you please tell
me how?
2) Is this a valid way to analyse this data, and if not, could someone
please put me in the right way?


Thank you very very much to all in advance

Jérôme Lemaître

Étudiant au doctorat
Université Laval
Québec, QC  G1K 7P4

__
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] Cox regression on interval censoring

2005-09-29 Thread David Hannersjö
Regarding non-parametric regression with interval censored survival data: Does 
anyone know where to find an extension dealing with Cox regression for 
(overlapping) interval censored data? If not, maybe someone has some ML 
expressions for this interval scenario laying around that you are willing to 
share? I would be really really greatful!

Thanks and best regards // David

*
D. Hannersjoe
Department of Aquaculture
Swedish University of Agricultural Science
SWEDEN
E-mail: [EMAIL PROTECTED]

*
###

This message has been scanned by F-Secure Anti-Virus for Mic...{{dropped}}

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


Re: [R] Fast AUC computation

2005-09-29 Thread Tuszynski, Jaroslaw W.
See colAUC in caTools (there is a problem with 1.3 version, 1.4 is on the
way). See examples for other functions calculating AUC. An alternative
approach is:

  x1 = x[y==1]; n1 = length(x1); 
  x2 = x[y==0]; n2 = length(x2);
  r = rank(c(x1,x2))  
auc = (sum(r[1:n1]) - n1*(n1+1)/2) / (n1*n2) 

Which is very fast.

Jarek 
\ 
 Jarek Tuszynski, PhD.   o / \ 
 Science Applications International Corporation  \__,|  
 (703) 676-4192 \ 
 [EMAIL PROTECTED] `   \ 



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Nina Paynter
Sent: Wednesday, September 28, 2005 4:43 PM
To: r-help@stat.math.ethz.ch
Subject: [R] Fast AUC computation

I am doing a simulation with a relatively large data set (20,000
observations) for which I want to calculate the area under the Receiver
Operator Curve (AUC) for many parameter combinations.  I am using the ROC
library and the following commands to generate each AUC:

 

rocobj=rocdemo.sca(truth = ymis, data = model$fitted.values, rule =
dxrule.sca) #generation of observed ROC object

aucobj=AUC(rocobj) #pulling out just the observed AUC - trapezoidal not
integrated

 

but they are pretty slow.

 

Does anyone know of a faster way to get the AUC?

 

Thanks,

Nina


[[alternative HTML version deleted]]

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

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


[R] Fisher's discriminant functions

2005-09-29 Thread C NL
Hi everyone,

  I'm trying to solve a problem about how to get the
Fisher's discriminant functions of a lda (linear
discriminant analysis) object, I mean, the object
obtained from doing lda(formula, data) function of
the package MASS in R-project. This object gives me
the canonical linear functions (n-1 coefficients
matrix of n groups at least), and only with this
information I could predict the group of an
observation data using the predict function. But
what I need is the Fisher's discriminant functions (n
coefficients matrix of n groups) in order to classify
my future data.

   The object predict gives me only the following
attributes x, posterior and class, but none of
them are the coefficients matrix of the Fisher's
discriminant functions, and the reason why I'm not
using the predict function for my predictions is
because the time spent is very high for what I'm
expecting, about 0.5 seconds while I can obtain this
prediction with the Fisher's discriminant functions
faster.

   So, I don't know if there's a package which I can
use to obtain the mentioned coefficients matrix of the
Fisher's discriminant functions.

   I anyone can help, I would appreciate it greatly.

Thank you and regards.

   Carlos Niharra López

__
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] Error using a data frame as the start parameter in mle()

2005-09-29 Thread Coryn Bailer-Jones
Dear R-Users,

I am trying to use mle() to optimize two (or more) parameters, but I want
to specify those parmeters in a data frame rather than having to spell
them out separately in the start variable of mle().

My call is

 mle(negll, start=list(aps=init), fixed=list(measphot=newphot,
formod=formod, Nbands=Nbands), method=BFGS)

where negll is a function I have written which uses the function
predict.loess(). negll works fine when called directly. The parameter I am
trying to optimize, aps, is a data frame containing two parameters, e.g.

 init
  teff logg
1 8000  4.5

When I run mle I get the following error message

Error in predict.loess(formod[[band]], aps) :
Argument aps is missing, with no default

As negll does work fine, I presume I am incorrectly passing aps into
mle(). Note that mle() works fine if I rewrite negll to work on a scalar
aps and then I use start=list(aps=500), for example. Can anyone help me
with this?

Incidentally, I am only using a data frame for aps because I am using
loess(), and this seems to require a formula with named variables in a
data frame (here logg and teff). I can't get it work with arrays:

 temp - loess(formula = photd[, band] ~ gridaps[, 1] * gridaps[, 2])
 predict(temp, c(4,8000))
Error in predict.loess(temp, c(4, 8000)) :
newdata does not contain the variables needed

Thanks in advance for any clues.

Coryn.

---
Coryn Bailer-Jones[EMAIL PROTECTED]
Max-Planck-Institut fuer Astronomie   http://www.mpia-hd.mpg.de/homes/calj/
Koenigstuhl 17tel: +49 6221 528-224(direct)
D-69117 Heidelberg +49 6221 528-0   (reception)
Germany   fax: +49 6221 528-246

__
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] Easy cut paste from Excel to R?

2005-09-29 Thread Petr Pikal
Hi

Works for me.

write.excel - function (tab, ...) write.table(tab, clipboard, sep 
= \t, row.names = F)

write.excel(a)

from your example shows in Excel after ctrl-V as a table with names.

HTH

Petr





On 29 Sep 2005 at 12:12, Jose Quesada wrote:

Date sent:  Thu, 29 Sep 2005 12:12:00 +0100
From:   Jose Quesada [EMAIL PROTECTED]
To: Werner Wernersen [EMAIL PROTECTED]
Copies to:  r-help@stat.math.ethz.ch
Subject:Re: [R] Easy cut  paste from Excel to R?
Send reply to:  Jose Quesada [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]

 Sorry to revive and old topic, but writing to the clipboard seems to
 have a problem for me: column names are ignored. Example:
 
 # ~~~
 # write.clipboard
 # ~~~
 write.clipboard = function(obj) {
  write.table(obj, file(clipboard), sep=\t, row.names=F,
  col.names=T)
 }
 
 a= matrix(1:4,2,2)
 colnames(a) = c(a, b)
 
 write.clipboard(a)
 a = as.data.frame(a)
 write.clipboard(a)
 
 both attempts will paste the date without column names.
 Any idea why?
 
 Thanks,
 -Jose
 
 On 2/16/05, Werner Wernersen [EMAIL PROTECTED] wrote:
  Thank you all very much for the answers!
  The read.table / read.delim2 commands are exactly what
  I was looking for to get
  a couple of numbers or a little matrix quickly into R
  without creating an extra
  text file every time.
 
  And it works the other way around as well:
  write.table(x, file(clipboard), sep=\t)
  Fantastic!
 
  Thanks again,
 Werner
 
  Nick Drew wrote:
   I've had good luck with the scan() function when I
   want to get a few numbers from Excel into R quickly
  to
   use it as a calculator. CAVEAT: you have to have the
   numbers you want to copy in a column not a row in
   Excel. For example:
  
   In Excel your data are in a column as follows:
   Col A
   1
   2
   3
  
   Then copy the 3 cells (e.g. 1, 2,3) in Excel and
  open
   R and type in:
  
  data - scan()
  
  
   Then Paste using Ctrl-V. Hit the Enter key. You know
   have an object called data that you can use and
   manipulate in R.
  
   I've taken this even further by creating an R
  function
   that will take a column of numbers from Excel and
  then
   scan() them into R, create a matrix, and then
  perform
   a Chi-square test. Let me know if you'd like to know
   more. I'm a beginner and if I can do so can you!!
  
   ~Nick
  
  
  
 
   __
   Do you Yahoo!?
 
 
   http://promotions.yahoo.com/new_mail
  
  
 
  __
  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
 
 
 
 --
 Jose Quesada, PhD.
 
 [EMAIL PROTECTED] ESRC Postdoctoral Fellow
 http://lsa.colorado.edu/~quesadaj Dept. of PSychology
 http://www.andrew.cmu.edu/~jquesada   University of Warwick
 office H114   Phone: +44 024 765 23 
 759
 Coventry, UK
 
 __
 R-help@stat.math.ethz.ch mailing list
 https://stat.ethz.ch/mailman/listinfo/r-help
 PLEASE do read the posting guide!
 http://www.R-project.org/posting-guide.html

Petr Pikal
[EMAIL PROTECTED]

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


Re: [R] boxplot and xlim confusion?

2005-09-29 Thread Petr Pikal
Hi

So you need x to be same in all subsequent plots e.g. from -5 to 5 
like in this.

boxplot(split(rnorm(30), rep(1:3, each=10)), horizontal =T, 
names=letters[1:3], ylim=c(-5,5))

You find it in a thorough reading bxp man page.

Currently, 'ylim' is used 'along the boxplot', i.e.,
  vertically, when 'horizontal' is false. 

So if horizontal is true you still need to use ylim not xlim :-)

HTH
Petr


On 29 Sep 2005 at 15:28, Karin Lagesen wrote:

To: Petr Pikal [EMAIL PROTECTED]
From:   Karin Lagesen [EMAIL PROTECTED]
Date sent:  Thu, 29 Sep 2005 15:28:14 +0200
Copies to:  [EMAIL PROTECTED],
Karin Lagesen [EMAIL PROTECTED]
Subject:Re: [R] boxplot and xlim confusion?

 Petr Pikal [EMAIL PROTECTED] writes:
 
  Hi Karin
 
  I did not have seen any answer for your question yet so here is a
  try.
 
  I gues you want the horizotal layout or your boxplot.
 
  boxplot(split(rnorm(30), rep(1:3, each=10)), horizontal =T, 
  names=letters[1:3])
 
  boxplot(split(rnorm(30), rep(1:3, each=10)), horizontal =T, 
  names=c(NA,b,NA))
 
 These look like the plots I want, yes. However, is there a way of
 locking the x-axis? When I do these several times in a row, the range
 of the x axis moves with the data being plotted. If I set xlim in the
 boxplot command, it makes no difference what so ever.
 
 
  So this is closest what I could dig from your text.
 
  ***reproducible*** example would by good starting point what you
  want and was not able to produce.
 
 Sorry about that...:)
 
 Karin
 -- 
 Karin Lagesen, PhD student
 [EMAIL PROTECTED]
 http://www.cmbn.no/rognes/
 
 __
 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

Petr Pikal
[EMAIL PROTECTED]

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


Re: [R] quasi-random vector according to an independent graph

2005-09-29 Thread Spencer Graves
  Are you still interested in a reply to this post?  I have not seen 
any.  If you are, it might help if you were more specific, e.g., 
following the posting guide www.R-project.org/posting-guide.html.  I'm 
not certain what you mean by a joint distribution defined by an 
independent graph, and my efforts using RSiteSearch exposed several 
things that might be useful but none that seemed to me to be obvious 
answers to your question.

  Sorry I could not be more helpful.
  spencer graves

Jinfang Wang wrote:

 Dear R-users,
 
 Is anyone aware of any function/package for generating a random vector from 
 a joint distribution defined by an independent graph? Or I have to work it 
 out myself?
 
 Thanks.
 
 Jinfang
 
 --
 Jinfang Wang, Associate Professor
 Chiba University, Japan
 
 __
 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

-- 
Spencer Graves, PhD
Senior Development Engineer
PDF Solutions, Inc.
333 West San Carlos Street Suite 700
San Jose, CA 95110, USA

[EMAIL PROTECTED]
www.pdf.com http://www.pdf.com
Tel:  408-938-4420
Fax: 408-280-7915

__
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 get the rowindices without using which?

2005-09-29 Thread Spencer Graves
  I'm  not certain what you are asking.  Consider the following:

set.seed(1)
(irows - sample(1:nrow(iris), 10))
iris[irows,]

  If you want more than this, PLEASE do read the posting guide! 
www.R-project.org/posting-guide.html.  I believe that people who 
follow the posting guide generally get quicker and better answers than 
those who don't.

  spencer graves

Martin Lam wrote:

 Hi,
 
 I was wondering if it is possible to get the
 rowindices without using the function which because
 I don't have a restriction criteria. Here's an example
 of what I mean:
 # take 10 randomly selected instances
 iris[sample(1:nrow(iris), 10),]
 
 # output
 Sepal.Length Sepal.Width Petal.Length Petal.Width 
   Species
 76   6.6 3.0  4.4 1.4
 versicolor
 105  6.5 3.0  5.8 2.2 
 virginica
 131  7.4 2.8  6.1 1.9 
 virginica
 79   6.0 2.9  4.5 1.5
 versicolor
 69   6.2 2.2  4.5 1.5
 versicolor
 42   4.5 2.3  1.3 0.3 
setosa
 25   4.8 3.4  1.9 0.2 
setosa
 129  6.4 2.8  5.6 2.1 
 virginica
 60   5.2 2.7  3.9 1.4
 versicolor
 80   5.7 2.6  3.5 1.0
 versicolor
 
 What I want to get are their rownumbers: 76, 105, 131,
 79, 69, 42, 25, 129, 60, 80.
 
 Thanks in advance,
 
 Martin
 
 __
 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

-- 
Spencer Graves, PhD
Senior Development Engineer
PDF Solutions, Inc.
333 West San Carlos Street Suite 700
San Jose, CA 95110, USA

[EMAIL PROTECTED]
www.pdf.com http://www.pdf.com
Tel:  408-938-4420
Fax: 408-280-7915

__
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] Producing empirical bayes estimates in disease mapping for lognormal model

2005-09-29 Thread Spencer Graves
  I just got 74 hits from RSiteSearch(empirical bayes), 0 from 
RSiteSearch(empirical bayes lognormal), and 18 from 
RSiteSearch(empirical bayes normal).  Have you tried this?

  If you still would like information from this list, PLEASE do read 
the posting guide! www.R-project.org/posting-guide.html.  I believe 
that people who do usually get better answers quicker.

  spencer graves

Oarabile Molaodi wrote:

 I'm trying to produce empirical bayes estimates based on the lognormal 
 model  in disease mapping
 Is there a way this can be done in R?
 
 thanks
 Oarabile
 
 __
 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

-- 
Spencer Graves, PhD
Senior Development Engineer
PDF Solutions, Inc.
333 West San Carlos Street Suite 700
San Jose, CA 95110, USA

[EMAIL PROTECTED]
www.pdf.com http://www.pdf.com
Tel:  408-938-4420
Fax: 408-280-7915

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

2005-09-29 Thread Dirk Eddelbuettel
Prof Brian Ripley ripley at stats.ox.ac.uk writes:
 chart.yahoo.com is notoriously fickle (as we have seen from the tseries 

Maybe we should update the base URL. I maintain CPAN's Finance::YahooQuote
(and am author of two apps, also on CPAN, which use it fairly heavily) and 
this has been nothing but rock solid in the six years that I've been scraping 
data from Yahoo, often at a once-a-minute frequency (for the smtm quote display
tool). Of note is that Finance::YahooQuote uses a different machine:

   $QURLbase = http://quote.yahoo.com/d?f=;;

but both chart.yahoo.com and quote.yahoo.com appear to be on the same subnet.
Not sure I'll have time to patch tseries, but it is something we may need to
keep in mind.

Hth, Dirk

__
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] Display values in piechart/barplot

2005-09-29 Thread Volker Rehbock
Is it possible to automatically display the underlying values of a 
piechart/barplot in the graphic? If so, which package/function/argument do I 
need for it?
Thanks,
Volker

__
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 add frame (frame.plot=T) to Plot.Design?

2005-09-29 Thread Jan Verbesselt
Hi R-help,

 

When using the package Design and the plot.Design function all the graphs of
an lrm.fit (lrm()) are plotted without a frame (only with axes). How can the
frame be added to these plots?

 

In the plot.default function the frame can be added/or removed via the
frame.plot=T/F, respectively.

e.g., plot(1,axes=T,frame.plot=T). How can this be done with
plot.Design(lrm.fit)

 

Thanks,

Jan

 

___
Ir. Jan Verbesselt
Research Associate
Biosystems Department ~ M³-BIORES
Vital Decosterstraat 102, 3000 Leuven, Belgium
Tel: +32-16-329750   Fax: +32-16-329760
http://gloveg.kuleuven.ac.be/
___

 



Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm


[[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] regsubsets selection criterion

2005-09-29 Thread Spencer Graves
  Questions like this are best directed to the package maintainer(s). 
 From help(package=leaps), I learned that Thomas Lumley is the author 
and maintainer for leaps;  I'm including him as a 'cc', so he can 
correct or add to my comments if he feels so inclined.

  After some searching, I learned that ?plot.regsubsets includes an 
argument scale=c(bic, Cp, adjr2, r2).  From this, I infer that 
you have your choice of these four criteria.

  hope this helps.
  spencer graves

Samuel Bertrand wrote:

 Hello,
 
 I am using the 'regsubsets' function
 (from leaps package)
 to get the best linear models
 to explain 1 variable
 from 1 to 5 explanatory variables
 (exhaustive search).
 
 Is there anyone who can tell me
 on which criterion is based
 the 'regsubsets' function ?
 
 Thank you.
 
 samuel
 
 
 
 
 
 Samuel BERTRAND
 Doctorant
 Laboratoire de Biomecanique
 LBM - ENSAM - CNRS UMR 8005
 http://bio-web.paris.ensam.fr
 151, bd de l'Hopital
 75013 PARIS
 Tel. +33 (0) 1 44 24 64 53
 Fax +33 (0) 1 44 24 63 66
 
   [[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

-- 
Spencer Graves, PhD
Senior Development Engineer
PDF Solutions, Inc.
333 West San Carlos Street Suite 700
San Jose, CA 95110, USA

[EMAIL PROTECTED]
www.pdf.com http://www.pdf.com
Tel:  408-938-4420
Fax: 408-280-7915

__
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] regsubsets selection criterion

2005-09-29 Thread Thomas Lumley
On Thu, 29 Sep 2005, Spencer Graves wrote:

 Questions like this are best directed to the package maintainer(s). 
 From help(package=leaps), I learned that Thomas Lumley is the author and 
 maintainer for leaps;  I'm including him as a 'cc', so he can correct or 
 add to my comments if he feels so inclined.

He has already answered this question when it was originally posted.

-thomas

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

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


Re: [R] quasi-random vector according to an independent graph

2005-09-29 Thread Huntsinger, Reid
Might the graphical models in R packages be of interest?
http://www.r-project.org/gR/

Reid Huntsinger

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Spencer Graves
Sent: Thursday, September 29, 2005 11:43 AM
To: Jinfang Wang
Cc: r-help@stat.math.ethz.ch
Subject: Re: [R] quasi-random vector according to an independent graph


  Are you still interested in a reply to this post?  I have not seen

any.  If you are, it might help if you were more specific, e.g., 
following the posting guide www.R-project.org/posting-guide.html.  I'm 
not certain what you mean by a joint distribution defined by an 
independent graph, and my efforts using RSiteSearch exposed several 
things that might be useful but none that seemed to me to be obvious 
answers to your question.

  Sorry I could not be more helpful.
  spencer graves

Jinfang Wang wrote:

 Dear R-users,
 
 Is anyone aware of any function/package for generating a random vector
from 
 a joint distribution defined by an independent graph? Or I have to work it

 out myself?
 
 Thanks.
 
 Jinfang
 
 --
 Jinfang Wang, Associate Professor
 Chiba University, Japan
 
 __
 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

-- 
Spencer Graves, PhD
Senior Development Engineer
PDF Solutions, Inc.
333 West San Carlos Street Suite 700
San Jose, CA 95110, USA

[EMAIL PROTECTED]
www.pdf.com http://www.pdf.com
Tel:  408-938-4420
Fax: 408-280-7915

__
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] Display values in piechart/barplot

2005-09-29 Thread Marc Schwartz (via MN)
On Thu, 2005-09-29 at 14:34 +0200, Volker Rehbock wrote:
 Is it possible to automatically display the underlying values of a 
 piechart/barplot in the graphic? If so, which package/function/argument do I 
 need for it?
 Thanks,
 Volker


Using pie charts are not a particularly good way of displaying data,
even though the pie() function is available in R. See ?pie for more
information on this.

For barplots, the following provide two approaches:


# Place the bar values above the bars
# Note that I set 'ylim' to make room for 
# the text labels above the bars

vals - 1:5
names(vals) - LETTERS[1:5]
mp - barplot(vals, ylim = c(0, 6))
text(mp, vals, labels = vals, pos = 3)



# Place the bar values below the x axis

vals - 1:5
names(vals) - LETTERS[1:5]
mp - barplot(vals)
mtext(side = 1, at = mp, text = vals, line = 3)


Note that barplot() returns the bar midpoints, so you can use these
values for annotation placement.

See ?barplot, ?text and ?mtext for more information.

HTH,

Marc Schwartz

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


[R] plot.augPred sorted and labelled according second factor

2005-09-29 Thread Christoph Lehmann
Hi

using this code example:

library(nlme)
fm1 - lme(Orthodont, random = ~1)
plot(augPred(fm1))

is there any way to have the plots in each cell labelled and ordered
according to Orthodont$Sex? I.e. in addition to the bar with the label for
Orthodont$Subject there is another bar labelling the Sex of the subject?

thanks a lot

christoph

--

__
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] lmer random effect model matrix question

2005-09-29 Thread Mark Lyman
I have one fixed effect, sor, with two levels. I have eight lots and 
three wafers from each lot. I have included the data below.

I would like to fit a mixed model that estimates a covariance parameter 
for wafer, which is nested in lot, and two covariance parameters for 
lot, one for each level of sor. The following command fits the model 
that I want, except for it estimates the correlation between the two 
covariance parameters for lot. Is there anyway to make R not estimate 
this correlation? Thank you.

lmer(y~sor+(sor-1|lot)+(1|wafer:lot),wafer)

For those familiar with proc mixed the following SAS code fits the model 
that I want:

proc mixed scoring=4;
   class sor lot wafer site;
   model y= sor/ddfm=satterth;
   random lot(sor)/group=sor;
   random wafer(lot);
run;

   sor lot wafer sitey
11   1 11 2006
21   1 12 1999
31   1 13 2007
41   1 21 1980
51   1 22 1988
61   1 23 1982
71   1 31 2000
81   1 32 1998
91   1 33 2007
10   1   2 11 1991
11   1   2 12 1990
12   1   2 13 1988
13   1   2 21 1987
14   1   2 22 1989
15   1   2 23 1988
16   1   2 31 1985
17   1   2 32 1983
18   1   2 33 1989
19   1   3 11 2000
20   1   3 12 2004
21   1   3 13 2004
22   1   3 21 2001
23   1   3 22 1996
24   1   3 23 2004
25   1   3 31 1999
26   1   3 32 2000
27   1   3 33 2002
28   1   4 11 1997
29   1   4 12 1994
30   1   4 13 1996
31   1   4 21 1996
32   1   4 22 2000
33   1   4 23 2002
34   1   4 31 1987
35   1   4 32 1990
36   1   4 33 1995
37   2   5 11 2013
38   2   5 12 2004
39   2   5 13 2009
40   2   5 21 2023
41   2   5 22 2018
42   2   5 23 2010
43   2   5 31 2020
44   2   5 32 2023
45   2   5 33 2015
46   2   6 11 2032
47   2   6 12 2036
48   2   6 13 2030
49   2   6 21 2018
50   2   6 22 2022
51   2   6 23 2026
52   2   6 31 2009
53   2   6 32 2010
54   2   6 33 2011
55   2   7 11 1984
56   2   7 12 1993
57   2   7 13 1993
58   2   7 21 1992
59   2   7 22 1992
60   2   7 23 1990
61   2   7 31 1996
62   2   7 32 1993
63   2   7 33 1987
64   2   8 11 1996
65   2   8 12 1989
66   2   8 13 1996
67   2   8 21 1997
68   2   8 22 1993
69   2   8 23 1996
70   2   8 31 1990
71   2   8 32 1989
72   2   8 33 1992

__
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 add frame (frame.plot=T) to Plot.Design?

2005-09-29 Thread Marc Schwartz (via MN)
On Thu, 2005-09-29 at 18:36 +0200, Jan Verbesselt wrote:
 Hi R-help,
 
  
 
 When using the package Design and the plot.Design function all the graphs of
 an lrm.fit (lrm()) are plotted without a frame (only with axes). How can the
 frame be added to these plots?
 
  
 
 In the plot.default function the frame can be added/or removed via the
 frame.plot=T/F, respectively.
 
 e.g., plot(1,axes=T,frame.plot=T). How can this be done with
 plot.Design(lrm.fit)
 
  
 
 Thanks,
 
 Jan


See ?box

HTH,

Marc Schwartz

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


[R] Reading Health Level Seven (HL 7) data format into R

2005-09-29 Thread White, Charles E WRAIR-Wash DC
Has anyone developed code for reading HL 7 formatted data into R? HL 7
is an open standard for the digital transfer of health care information.
It's moving towards XML but it isn't there yet. A study I started
working on today will be receiving lab data in that format. I'd rather
not reinvent any more wheels than strictly necessary. Thanks for your
time.

Chuck

__
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] need suggestion about building formual

2005-09-29 Thread Spencer Graves
  I'm not certain what you are asking.

  You can build expressions in R as character strings and then execute 
them.  Example:

expr - paste(two -, 1, +, 1)
eval(parse(text=expr))
two

  If this does not answer your question, PLEASE do read the posting 
guide, www.R-project.org/posting-guide.html.  It can help increase the 
chances of a quick and useful reply.

  spencer graves

Simple wrote:

 hi,
 I'm an newbie for R,I want do some fitting in R.
 
 I wander if it is possible to write a few of equations but only one formual 
 when fitting 
 
 Currently,My problem is,in R, is there methods combination a few equations 
 into one formual?
 For example, 
 y=f1(k);
 k=f2(t);
 t=f3(x);
 although it is certain that the can be equations turn into one formual as 
 y~f(x),but write such a complexity string make me painful.
 
 I have searched the web and found out there were only examples with one 
 formual.any suggestion? 
 
 I hope that I have omit something.
 
 __
 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

-- 
Spencer Graves, PhD
Senior Development Engineer
PDF Solutions, Inc.
333 West San Carlos Street Suite 700
San Jose, CA 95110, USA

[EMAIL PROTECTED]
www.pdf.com http://www.pdf.com
Tel:  408-938-4420
Fax: 408-280-7915

__
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] standard error of variances and covariances of the random effects with LME

2005-09-29 Thread Douglas Bates
With lme you could but it would take a while to work it out.  There is
an approximate Hessian matrix for the parameters that determine the
variance-covariance matrix in there somewhere and if you were
sufficiently persistent you could convert that apVar component to the
scale of the variances and covariances.  I believe it is in the scale
of the logarithm of the standard deviation and Fisher's z
transformation (i.e. the hyperbolic arc tangent) of the correlation.

On 9/29/05, Doran, Harold [EMAIL PROTECTED] wrote:
 You cannot. Also, it's not that the distribution of the random effects
 is not symmetric, but that it *may* not be symmetric, and this is an
 assumption that should be checked.

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of Roel de Jong
 Sent: Thursday, September 29, 2005 9:20 AM
 To: r-help@stat.math.ethz.ch
 Subject: [R] standard error of variances and covariances of the random
 effects with LME

 Hello,

 how do I obtain standard errors of variances and covariances of the
 random effects with LME comparable to those of for example MlWin? I know
 you shouldn't use them because the distribution of the estimator isn't
 symmetric blablabla, but I need a measure of the variance of those
 estimates for pooling my multiple imputation results.

 Regards,
Roel.

 __
 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] anova on binomial LMER objects

2005-09-29 Thread Douglas Bates
The issues with lmer and the analysis of variance are due to its not
make appropriate correction for the prior weights vector.  If you
convert your binomial response to the equivalent number of binary
responses you get an appropriate anova table.

It's on the ToDo list to fix this but a few other things have to
come first, like grading assignments in one of my courses and
repairing the computer in my office.  This is the third motherboard I
have torched in four months.



On 9/29/05, Alan Cobo-Lewis [EMAIL PROTECTED] wrote:
 On Wed, 28 Sep 2005, Robert Bagchi wrote:
 Hi Patrick
 
 thanks for your advice. I have now tried glmmPQL, and it worked fine -
 I'm getting consistent results between plots and models fitted by
 glmmPQL. Plus it allows predict() and resid() which is another advantage
 over lmer at present.
 
 quick question though: why does one need to use PQL for binomial models?
 Is there a good reference for this?
 
 You don't have to use PQL for binomial models, but you can't use 
 least-squares. PQL is an approximate solution. Laplace and Adaptive Gaussian 
 Quadrature options in lmer are better approximations. So lmer would likely 
 become the better option as it
 progresses in its development (though the current issues you've found with 
 the F ratios certainly sound like maybe lmer isn't better for you in its 
 current incarnation).
 alan

 --
 Alan B. Cobo-Lewis, Ph.D.   (207) 581-3840 tel
 Department of Psychology(207) 581-6128 fax
 University of Maine
 Orono, ME 04469-5742[EMAIL PROTECTED]

 http://www.umaine.edu/visualperception

 __
 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] Saving Graphics

2005-09-29 Thread Mike Jones
Hello all,

I'm having difficulty automatically saving graphs.

Is there a way to save graphs from the graphics window using commands in
the R console?  

Thanks very much.

[[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] Problem with memory footprint of qq plot generated with lattice

2005-09-29 Thread dhinds
Witold Eryk Wolski [EMAIL PROTECTED] wrote:

 Adding f.value=fn as argument to qqmath reduces the size of the image, 
 but neither the axis (absicissae) nor the line added by panel.qqmathline 
 are right.

 Adding f.value=fn as argument to panel.qqmathline and panel.qqmath 
 generates the right graphic, but the size of the image is again 20 MB.

 Any Suggestions?

Neither panel.qqmathline nor panel.qqmath pay any attention to an
f.value argument.

It looks like panel.qqmathline() effectively assumes that f.value is
uniformly distributed.  I guess you could rewrite panel.qqmathline and
prepanel.qqmathline but I don't see a clean solution.

-- Dave

__
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] solution of convolution equation

2005-09-29 Thread Anna Oganyan
Hello,
May be somebody can help me...
I am trying to find a solution of a convolution equation using fft (and 
unfortunately I do not have a good background for this).
So I am just trying to figure out how it can be implemented in R. I have 
two multidimensional independent variables X and Z
and I know their densities fx and fz, which are multidimensional arrays. 
So I have to find the density of Y, such that X+Y=Z.
So, first I tried on a simple example, where the variables are 
one-dimensional, say X is N(0,1) and Z is N(7,3).
So I want to find the density of Y (which should be N(7, sqrt(8)).
I did:
x - seq(-6, 20, length=500)
fx - dnorm(x)
z - seq(-6, 20, length=500)
fz - dnorm(z, mean=7, sd=3)
ffty - fft(fz)/fft(fx)
fy - fft(ffty, inverse=T)/length(ffty)
plot(Re(fy))

But the plot is far from being normal. May be the problem is with the 
lengths of fx and fz? should they be of different lengths and fx padded 
with zeros? May be somebody could point out that…? Thanks!
Anna

__
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] Saving Graphics

2005-09-29 Thread Doran, Harold
See ?pdf or ?postscript 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Mike Jones
Sent: Thursday, September 29, 2005 3:22 PM
To: r-help@stat.math.ethz.ch
Subject: [R] Saving Graphics

Hello all,

I'm having difficulty automatically saving graphs.

Is there a way to save graphs from the graphics window using commands in
the R console?  

Thanks very much.

[[alternative HTML version deleted]]

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

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


Re: [R] lmer random effect model matrix question

2005-09-29 Thread Douglas Bates
I would create two 0/1 variables for sor level 1 and sor level 2 and
use those as in

 mark$sor1 - ifelse(mark$sor == 1, 1, 0)
 mark$sor2 - ifelse(mark$sor == 2, 1, 0)
 (fm1 - lmer(y ~ sor + (0+sor1|lot) + (0+sor2|lot) + (1|wafer:lot), mark))
Linear mixed-effects model fit by REML
Formula: y ~ sor + (0 + sor1 | lot) + (0 + sor2 | lot) + (1 | wafer:lot)
   Data: mark
  AIC  BIClogLik MLdeviance REMLdeviance
 455.7631 469.4231 -221.8816   453.5174 443.7631
Random effects:
 GroupsNameVariance Std.Dev.
 wafer:lot (Intercept)  35.866   5.9888
 lot   sor2222.709  14.9234
 lot   sor1 17.076   4.1323
 Residual   12.569   3.5453
# of obs: 72, groups: wafer:lot, 24; lot, 8; lot, 8

Fixed effects:
 Estimate Std. Error DF  t value Pr(|t|)
(Intercept) 1995. 2.7581 70 723.3703   2e-16 ***
sor2  10.0833 8.1622 70   1.2354   0.2208
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1


On 9/29/05, Mark Lyman [EMAIL PROTECTED] wrote:
 I have one fixed effect, sor, with two levels. I have eight lots and
 three wafers from each lot. I have included the data below.

 I would like to fit a mixed model that estimates a covariance parameter
 for wafer, which is nested in lot, and two covariance parameters for
 lot, one for each level of sor. The following command fits the model
 that I want, except for it estimates the correlation between the two
 covariance parameters for lot. Is there anyway to make R not estimate
 this correlation? Thank you.

 lmer(y~sor+(sor-1|lot)+(1|wafer:lot),wafer)

 For those familiar with proc mixed the following SAS code fits the model
 that I want:

 proc mixed scoring=4;
class sor lot wafer site;
model y= sor/ddfm=satterth;
random lot(sor)/group=sor;
random wafer(lot);
 run;

sor lot wafer sitey
 11   1 11 2006
 21   1 12 1999
 31   1 13 2007
 41   1 21 1980
 51   1 22 1988
 61   1 23 1982
 71   1 31 2000
 81   1 32 1998
 91   1 33 2007
 10   1   2 11 1991
 11   1   2 12 1990
 12   1   2 13 1988
 13   1   2 21 1987
 14   1   2 22 1989
 15   1   2 23 1988
 16   1   2 31 1985
 17   1   2 32 1983
 18   1   2 33 1989
 19   1   3 11 2000
 20   1   3 12 2004
 21   1   3 13 2004
 22   1   3 21 2001
 23   1   3 22 1996
 24   1   3 23 2004
 25   1   3 31 1999
 26   1   3 32 2000
 27   1   3 33 2002
 28   1   4 11 1997
 29   1   4 12 1994
 30   1   4 13 1996
 31   1   4 21 1996
 32   1   4 22 2000
 33   1   4 23 2002
 34   1   4 31 1987
 35   1   4 32 1990
 36   1   4 33 1995
 37   2   5 11 2013
 38   2   5 12 2004
 39   2   5 13 2009
 40   2   5 21 2023
 41   2   5 22 2018
 42   2   5 23 2010
 43   2   5 31 2020
 44   2   5 32 2023
 45   2   5 33 2015
 46   2   6 11 2032
 47   2   6 12 2036
 48   2   6 13 2030
 49   2   6 21 2018
 50   2   6 22 2022
 51   2   6 23 2026
 52   2   6 31 2009
 53   2   6 32 2010
 54   2   6 33 2011
 55   2   7 11 1984
 56   2   7 12 1993
 57   2   7 13 1993
 58   2   7 21 1992
 59   2   7 22 1992
 60   2   7 23 1990
 61   2   7 31 1996
 62   2   7 32 1993
 63   2   7 33 1987
 64   2   8 11 1996
 65   2   8 12 1989
 66   2   8 13 1996
 67   2   8 21 1997
 68   2   8 22 1993
 69   2   8 23 1996
 70   2   8 31 1990
 71   2   8 32 1989
 72   2   8 33 1992

 __
 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] Saving Graphics

2005-09-29 Thread Pierce, Ken
savePlot has been working quite well for me.

Ken

~~~
Kenneth B. Pierce Jr. 
Research Ecologist
Forestry Sciences Laboratory
3200 SW Jefferson Way
Corvallis, OR 97331
[EMAIL PROTECTED]
541 750-7393

  

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Mike Jones
Sent: Thursday, September 29, 2005 12:22 PM
To: r-help@stat.math.ethz.ch
Subject: [R] Saving Graphics

Hello all,

I'm having difficulty automatically saving graphs.

Is there a way to save graphs from the graphics window using commands in
the R console?  

Thanks very much.

[[alternative HTML version deleted]]

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

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


Re: [R] multidimensional integration

2005-09-29 Thread Spencer Graves
  Which version of R on which operating system crashes with which 
version of adapt?

  What are you trying to integrate?  Is it pure R, or do you link to 
something else like C++?  RSitSearch(integrate in 2 dimensions) 
produced 10 hits.  Other searches produced more.  My bottom line is that 
adapt has been around for a while.

  Can you provide a reproducible example of your problem -- preferably 
one as simple as possible, following the posting guide, 
www.R-project.org/posting-guide.html.  (I believe that people who 
follow the posting guide usually get quicker, more useful answers.)

  spencer graves

Marcel Prokopczuk wrote:
 dear all,
 
 i have the following problem: i want to integrate a two-dimensional
 function. unfortunately R crashes when i try to use adapt() and i get a nice
 windows message with some hex-code.
 do anybody of you knows how to avoid this or knows another more stable
 function than adapt()
 
 thanks a lot
 
 marcel
 
 __
 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

-- 
Spencer Graves, PhD
Senior Development Engineer
PDF Solutions, Inc.
333 West San Carlos Street Suite 700
San Jose, CA 95110, USA

[EMAIL PROTECTED]
www.pdf.com http://www.pdf.com
Tel:  408-938-4420
Fax: 408-280-7915

__
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-level in packages mgcv and gam

2005-09-29 Thread Denis Chabot
OK, I think I understand better but still have two points to clarify.

The first one is about the number of df. I think those who replied on  
this objected to the way I chose df, not the fact that I would run a  
model with 7.4 df per se. If I read you correctly, I artificially  
reduce my p-value by using the estimated df found in a mgcv gam model  
into another model where I fix df. This is fine, I am quite willing  
not to run a second model with a fixed df and instead tell my readers  
that my model is marginally significant with a p-value of 0.03.

This being said, do you know of guidelines for choosing df? A  
colleague told me he does not go above 10% of the number of points.  
Should I be concerned when mgcv estimates 7.4 df for 34 points? Note  
that for this particular model P  1e-16, and P is also very small if  
I fix df to either 4 or 7.

My second point is the difference between models fitted by packages  
gam and mgcv. Sure, some of you have said different algorithms. And  
when I specify dfs, shouldn't P-values be very similar for the 2  
packages? If not, what does it say of the confidence we can have in  
the models?

I draw your attention to this exampl: I obtained P-values of 0.50 and  
0.03 with packages gam and mgcv respectively:


  library(gam)
Loading required package: splines
  data(kyphosis)
  kyp1 - gam(Kyphosis ~ s(Number, 3), family=binomial, data=kyphosis)
  summary.gam(kyp1)

Call: gam(formula = Kyphosis ~ s(Number, 3), family = binomial, data  
= kyphosis)
Deviance Residuals:
 Min  1Q  Median  3Q Max
-1.3646 -0.6233 -0.4853 -0.3133  2.0965

(Dispersion Parameter for binomial family taken to be 1)

 Null Deviance: 83.2345 on 80 degrees of freedom
Residual Deviance: 71.9973 on 76. degrees of freedom
AIC: 79.9976

Number of Local Scoring Iterations: 7

DF for Terms and Chi-squares for Nonparametric Effects

  Df Npar Df Npar Chisq  P(Chi)
(Intercept)   1
s(Number, 3)  1   21.37149 0.50375

  detach(package:gam)
  library(mgcv)
This is mgcv 1.3-7
  kyp2 - gam(Kyphosis ~ s(Number, k=4, fx=T),  family=binomial,  
data=kyphosis)
  summary.gam(kyp2)

Family: binomial
Link function: logit

Formula:
Kyphosis ~ s(Number, k = 4, fx = T)

Parametric coefficients:
 Estimate Std. Error z value Pr(|z|)
(Intercept)  -1.5504 0.3342   -4.64 3.49e-06 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Approximate significance of smooth terms:
   edf Est.rank Chi.sq p-value
s(Number)   33  8.898  0.0307 *
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

R-sq.(adj) =  0.101   Deviance explained = 12.5%
UBRE score = 0.075202  Scale est. = 1 n = 81
  kyp2$deviance
[1] 72.85893
  kyp2$null.deviance
[1] 83.23447
  kyp2$df.null
[1] 80
  kyp2$df.residual
[1] 77

How can we explain this huge difference?

Denis


 Le 05-09-29 à 06:00, [EMAIL PROTECTED] a écrit :

 De : Henric Nilsson [EMAIL PROTECTED]
 Date : 29 septembre 2005 03:55:19 HAE
 À : [EMAIL PROTECTED]
 Cc : r-help@stat.math.ethz.ch
 Objet : Rép : [R] p-level in packages mgcv and gam
 Répondre à : Henric Nilsson [EMAIL PROTECTED]


 Yves Magliulo said the following on 2005-09-28 17:05:

 hi,
 i'll try to help you, i send a mail about this subject last  
 week... and
 i did not have any response...
 I'm using gam from package mgcv. 1)
 How to interpret the significance of smooth terms is hard for me to
 understand perfectly : using UBRE, you fix df. p-value are  
 estimated by chi-sq distribution using GCV, the best df are  
 estimated by GAM. (that's what i want) and
 p-values


 This is not correct. The df are estimated in both cases (i.e. UBRE  
 and GCV), but the scale parameter is fixed in the UBRE case. Hence,  
 by default UBRE is used for family = binomial or poisson since the  
 scale parameter is assumed to be 1. Similarly, GCV is the default  
 for family = gaussian since we most often want the scale (usually  
 denoted sigma^2) to be estimated.


 are estimated by an F distribution But in that case they said use at
 your own risk in ?summary.gam


 The warning applies in both cases. The p-values are conditional on  
 the smoothing parameters, and the uncertainty of the smooths is not  
 taken into account when computing the p-values.


 so you can also look at the chi.sq : but i don't know how to choose a


 No...


 criterion like for p-values... for me, chi.sq show the best  
 predictor in
 a model, but it's hard to reject one with it.


 Which version of mgcv do you use? The confusion probably stems from  
 earlier versions of mgcv ( 1.3-5): the summary and anova methods  
 used to have a column denoted Chi.sq even when the displayed  
 statistic was computed as F. Recent versions of mgcv has

  summary(b)

 Family: gaussian
 Link function: identity

 Formula:
 y ~ s(x0) + s(x1) + s(x2) + s(x3)

 Parametric coefficients:
 Estimate Std. Error t value Pr(|t|)
 (Intercept)   7.9150 0.1049   

Re: [R] solution of convolution equation

2005-09-29 Thread Huntsinger, Reid
You need to pad both fx and fz with zeros to at least a length of length(fx)
+ length(fz) - 1, because you're really computing a circular convolution.
The same holds in higher dimensions (for each dimension).

Reid Huntsinger

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Anna Oganyan
Sent: Thursday, September 29, 2005 3:23 PM
To: r-help@stat.math.ethz.ch
Subject: [R] solution of convolution equation


Hello,
May be somebody can help me...
I am trying to find a solution of a convolution equation using fft (and 
unfortunately I do not have a good background for this).
So I am just trying to figure out how it can be implemented in R. I have 
two multidimensional independent variables X and Z
and I know their densities fx and fz, which are multidimensional arrays. 
So I have to find the density of Y, such that X+Y=Z.
So, first I tried on a simple example, where the variables are 
one-dimensional, say X is N(0,1) and Z is N(7,3).
So I want to find the density of Y (which should be N(7, sqrt(8)).
I did:
x - seq(-6, 20, length=500)
fx - dnorm(x)
z - seq(-6, 20, length=500)
fz - dnorm(z, mean=7, sd=3)
ffty - fft(fz)/fft(fx)
fy - fft(ffty, inverse=T)/length(ffty)
plot(Re(fy))

But the plot is far from being normal. May be the problem is with the 
lengths of fx and fz? should they be of different lengths and fx padded 
with zeros? May be somebody could point out that...? Thanks!
Anna

__
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] Fisher's discriminant functions

2005-09-29 Thread Kjetil Holuerson
This are in various packages, you could have a look at
ade4 (on CRAN).

Kjetil



C NL wrote:
 Hi everyone,
 
   I'm trying to solve a problem about how to get the
 Fisher's discriminant functions of a lda (linear
 discriminant analysis) object, I mean, the object
 obtained from doing lda(formula, data) function of
 the package MASS in R-project. This object gives me
 the canonical linear functions (n-1 coefficients
 matrix of n groups at least), and only with this
 information I could predict the group of an
 observation data using the predict function. But
 what I need is the Fisher's discriminant functions (n
 coefficients matrix of n groups) in order to classify
 my future data.
 
The object predict gives me only the following
 attributes x, posterior and class, but none of
 them are the coefficients matrix of the Fisher's
 discriminant functions, and the reason why I'm not
 using the predict function for my predictions is
 because the time spent is very high for what I'm
 expecting, about 0.5 seconds while I can obtain this
 prediction with the Fisher's discriminant functions
 faster.
 
So, I don't know if there's a package which I can
 use to obtain the mentioned coefficients matrix of the
 Fisher's discriminant functions.
 
I anyone can help, I would appreciate it greatly.
 
 Thank you and regards.
 
Carlos Niharra López
 
 __
 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] solution of convolution equation

2005-09-29 Thread Matthias Kohl
Anna Oganyan wrote:

Hello,
May be somebody can help me...
I am trying to find a solution of a convolution equation using fft (and 
unfortunately I do not have a good background for this).
So I am just trying to figure out how it can be implemented in R. I have 
two multidimensional independent variables X and Z
and I know their densities fx and fz, which are multidimensional arrays. 
So I have to find the density of Y, such that X+Y=Z.
So, first I tried on a simple example, where the variables are 
one-dimensional, say X is N(0,1) and Z is N(7,3).
So I want to find the density of Y (which should be N(7, sqrt(8)).
I did:
x - seq(-6, 20, length=500)
fx - dnorm(x)
z - seq(-6, 20, length=500)
fz - dnorm(z, mean=7, sd=3)
ffty - fft(fz)/fft(fx)
fy - fft(ffty, inverse=T)/length(ffty)
plot(Re(fy))

But the plot is far from being normal. May be the problem is with the 
lengths of fx and fz? should they be of different lengths and fx padded 
with zeros? May be somebody could point out that…? Thanks!
Anna

__
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
  

Hello Anna,

in our R package distr (on CRAN) we have implemented a convolution 
algorithm via fft.
See also: 
http://www.uni-bayreuth.de/departments/math/org/mathe7/KOHL/pubs/comp.pdf
respectively

library(distr)
getMethod(+, signature=c(AbscontDistribution,AbscontDistribution))

(or see the sources)

Unfortunatelly, we haven't implemented our algorithms for 
multidimensional distributions so far.

hope that helps,
Matthias

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

2005-09-29 Thread Deepayan Sarkar
On 9/28/05, Nathan Leon Pace, MD, MStat [EMAIL PROTECTED] wrote:

 A related question:

 My xyplot is essentially a time series (up-and-down experimental
 design). Thus I need to connect the points sequentially regardless of
 the group value. With the groups argument, type = 'b' gives two lines
 - one for each group.

xyplot(rnorm(100) ~ 1:100,
   groups = sample(1:2, 100, TRUE),
   panel = function(x, y, ..., type) {
   panel.lines(x, y, ...)
   panel.superpose(x, y, ..., type = 'p')
   })

__
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] Bug in lmer?

2005-09-29 Thread Mark Lyman
I am relatively new to R so I am not confident enough in what I am doing 
to be certain this is a bug. I am running R 2.1.1 on a Windows XP 
machine and the lme4 package version 0.98-1. The following code fits the 
model I want using the nlme package version 3.1-60.

mltloc$loc - factor(mltloc$loc)
mltloc$block - factor(mltloc$block)
mltloc$trt - factor(mltloc$trt)
Mltloc - groupedData(adg~trt|loc,mltloc)
plot(Mltloc)
plot(Mltloc,outer=~trt)

lme(adg~trt,
random=pdBlocked(list(pdIdent(~1),pdIdent(~block-1),pdIdent(~trt-1))),Mltloc)

The problem is that when I try fitting the model using the lmer function 
with the following code:

lmer(adg~trt+(1|loc)+(1|block:loc)+(1|loc:trt),mltloc)

I get this message from Windows and R closes.

R for Windows GUI front-end has encountered a problem and needs to 
close.  We are sorry for the inconvenience.

This same code works on a Macintosh. So it doesn't seem that I have made 
an error in my code. Also if anyone of the random effect terms is 
removed there is no problem. Is this something that is being looked at? 
Or I have I made a mistake somewhere? I have included the data that I am 
using below.


  X obs loc block trt adg  fe
1 1   3   A 1   3 3.16454  7.1041
2 2   4   A 1   4 3.12500  6.6847
3 3   6   A 1   2 3.15944  6.8338
4 4   7   A 1   1 3.25000  6.5254
5 5   9   A 2   2 2.71301  8.2505
6 6  10   A 2   1 3.20281  7.5922
7 7  12   A 2   3 3.02423  7.3894
8 8  16   A 2   4 2.87245  7.4604
9 9  19   A 3   1 2.68878  8.2785
10   10  20   A 3   2 2.86862  7.9470
11   11  21   A 3   3 2.89923  7.9739
12   12  22   A 3   4 3.02806  8.4331
13   13  25   B 1   3 2.18131  6.6691
14   14  27   B 1   4 2.51914  5.6281
15   15  28   B 1   2 1.88739  7.0723
16   16  31   B 1   1 2.34685  6.0295
17   17  33   B 2   4 2.45608  5.6195
18   18  35   B 2   1 2.25225  6.3978
19   19  36   B 2   3 2.23649  6.1799
20   20  40   B 2   2 2.47523  5.9985
21   21  41   B 3   2 1.94200  7.2975
22   22  44   B 3   3 2.43243  6.4350
23   23  47   B 3   4 2.30180  6.3339
24   24  48   B 3   1 2.53378  6.1564
25   25  50   C 1   4 2.96014  7.5110
26   26  51   C 1   2 3.23551  7.4762
27   27  54   C 1   3 3.24638  7.2063
28   28  56   C 1   1 3.04710  7.6389
29   29  58   C 2   3 3.26449  7.5466
30   30  59   C 2   2 2.71377  9.0895
31   31  61   C 2   1 3.06522  7.8723
32   32  62   C 2   4 2.71739  8.2318
33   33  66   C 3   4 3.03623  7.9426
34   34  67   C 3   3 3.10507  8.4608
35   35  69   C 3   1 3.16304  8.5549
36   36  70   C 3   2 3.02899  8.5038
37   37  74   D 1   1 2.49164  9.5758
38   38  77   D 1   3 2.51833  9.5121
39   39  79   D 1   2 2.35631 10.3264
40   40  80   D 1   4 2.30331  9.7715
41   41  81   D 2   3 2.72688  9.5628
42   42  83   D 2   2 2.59512  9.9414
43   43  85   D 2   1 2.56516  9.3887
44   44  88   D 2   4 2.91523  8.3158
45   45  89   D 3   3 2.57943 10.4416
46   46  90   D 3   4 2.98159  8.7710
47   47  93   D 3   2 2.35370 11.0148
48   48  94   D 3   1 2.21953 11.2417
49   49  99   E 1   3 2.84158  8.7886
50   50 100   E 1   4 2.65264  8.6946
51   51 102   E 1   2 2.47112  9.7143
52   52 103   E 1   1 2.89769  9.2401
53   53 105   E 2   2 2.57343  9.5353
54   54 106   E 2   1 2.99752  8.7538
55   55 110   E 2   4 2.95380  8.8210
56   56 112   E 2   3 3.08663  8.9427
57   57 114   E 3   1 2.72525  9.4308
58   58 115   E 3   2 2.75825  9.7721
59   59 116   E 3   3 3.08333  8.9010
60   60 117   E 3   4 3.12129  8.4852
61   61 122   F 1   1 3.20600  6.3983
62   62 123   F 1   2 2.89500  6.6569
63   63 125   F 1   4 3.36900  6.0821
64   64 126   F 1   3 3.12000  6.5349
65   65 130   F 2   2 3.19300  6.6729
66   66 131   F 2   1 3.29800  6.5488
67   67 133   F 2   4 3.09700  6.6598
68   68 135   F 2   3 3.38500  6.2998
69   69 139   F 3   3 3.44900  6.2849
70   70 140   F 3   2 3.05000  6.9957
71   71 141   F 3   1 3.43500  6.7302
72   72 143   F 3   4 3.60600  6.3827
73   73 145   G 1   2 2.58669  8.1394
74   74 147   G 1   1 3.17892  7.0972
75   75 148   G 1   4 2.95284  7.3140
76   76 151   G 1   3 3.17924  6.9430
77   77 154   G 2   4 2.62344  7.5150
78   78 155   G 2   3 2.64286  8.0237
79   79 157   G 2   1 3.12760  7.3169
80   80 160   G 2   2 2.54993  8.1957
81   81 163   G 3   4 2.58322  7.9687
82   82 164   G 3   3 2.84813  7.9284
83   83 166   G 3   2 2.69279  8.5303
84   84 167   G 3   1 3.14424  7.3564
85   85 169   H 1   3 3.39974  6.5945
86   86 173   H 1   2 3.12370  6.7530
87   87 175   H 1   4 3.17969  6.4279
88   88 176   H 1   1 3.70052  6.4830
89   89 177   H 2   2 2.95192  7.3809
90   90 179   H 2   3 3.44661  6.7929
91   91 182   H

Re: [R] standard error of variances and covariances of the random effects with LME

2005-09-29 Thread Kjetil Holuerson
Doran, Harold wrote:
 You cannot.

Yes. But when it is really needed, as the original poster
said, what would be wrong with taking the length of a
95% confidence interval and dividing into 4?

(of course it will be wrong, but so much as to be useless?)

Kjetil



  Also, it's not that the distribution of the random effects
 is not symmetric, but that it *may* not be symmetric, and this is an
 assumption that should be checked. 
 
 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of Roel de Jong
 Sent: Thursday, September 29, 2005 9:20 AM
 To: r-help@stat.math.ethz.ch
 Subject: [R] standard error of variances and covariances of the random
 effects with LME
 
 Hello,
 
 how do I obtain standard errors of variances and covariances of the
 random effects with LME comparable to those of for example MlWin? I know
 you shouldn't use them because the distribution of the estimator isn't
 symmetric blablabla, but I need a measure of the variance of those
 estimates for pooling my multiple imputation results.
 
 Regards,
Roel.
 
 __
 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] Select varying LS digits in long numbers?

2005-09-29 Thread Ted Harding
I've received what looks like a good -- and neat! -- solution
off-list from Hadley Wickham. Suppose numbers is a vector of
long integers. Then Hadley wrote:

  digits - outer(numbers, 10:0,
  function(x,y) numbers %/% 10^y %% 10)

  apply(digits,2, function(x) length(unique(x)))

This certainly looks cast-iron, and nicely passes my slipperiness
test:

  numbers-c(1234566999,1234567001)
  digits - outer(numbers, 10:0, function(x,y) numbers %/% 10^y %% 10)
  result-apply(digits,2, function(x) length(unique(x))); result
# [1] 1 1 1 1 1 1 1 2 2 2 2

  d1-min(which(result1)); d1
# [1] 8

  numbers%%(10^(12-d1))
# [1] 6999 7001

as desired!

Thanks also to Patrick Burns and Jim Holtman for other suggestions
based (in effect) on diff(range(numbers)).

On 29-Sep-05 Ted Harding wrote:
 Hi Folks,
 
 I'm trying to find a neat solution to an apparently simple
 problem, but one which turns out to be a bit more intricate
 and tricky than one might expect.
 
 Suppose I have numbers given to a large number of digits.
 For example
 
   1234567021
 
 where (though I don't know this beforehand) only the last
 3 digits will be varying (and all 3 will vary).
 
 What I want is, give a vector x of such numbers, to extract
 the minimal set of final digits which will include the varying
 digits (i.e. in this case the last 3 digits). And there may be
 a decimal point somewhere along the line (though again I won't
 know where, nor whether).
 
 I can think of brute-force ways of doing this, but I'd like
 a neat one!
 
 Best wishes to all,
 Ted.
 
 
 
 E-Mail: (Ted Harding) [EMAIL PROTECTED]
 Fax-to-email: +44 (0)870 094 0861
 Date: 29-Sep-05   Time: 18:45:26
 -- XFMail --
 
 __
 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


E-Mail: (Ted Harding) [EMAIL PROTECTED]
Fax-to-email: +44 (0)870 094 0861
Date: 29-Sep-05   Time: 22:35:15
-- XFMail --

__
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] Binary Logit Regression with R

2005-09-29 Thread Johann Park
Hi to all, 

I am a PH.D Student doing statistical analysis.
I am totally new to R. I previously use Stata and am changing into R. I 
ususally do with logit regression with binary dependent variable (war 
occurence:1 or 0). 

I just want to know command to do that. More sepcifically, 

Let say, my Y is war occurence (occur=1, otherwise 0). And my independent 
variables (Xs) are trade, democracy, military poweretc. 

In Stata, I do like what follows: 

logit war trade democracy militarypower... 

Then I will get results. 

What are the equivalent command in R? 

Many thanks, 

JP

__
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] Binary Logit Regression with R

2005-09-29 Thread Marc Schwartz (via MN)
On Thu, 2005-09-29 at 18:08 -0400, Johann Park wrote:
 Hi to all, 
 
 I am a PH.D Student doing statistical analysis.
 I am totally new to R. I previously use Stata and am changing into R. I 
 ususally do with logit regression with binary dependent variable (war 
 occurence:1 or 0). 
 
 I just want to know command to do that. More sepcifically, 
 
 Let say, my Y is war occurence (occur=1, otherwise 0). And my independent 
 variables (Xs) are trade, democracy, military poweretc. 
 
 In Stata, I do like what follows: 
 
 logit war trade democracy militarypower... 
 
 Then I will get results. 
 
 What are the equivalent command in R? 
 
 Many thanks, 
 
 JP

See ?glm in the base stats package or ?lrm in Frank Harrell's Design
package on CRAN.

BTW, doing:

  help.search(logit)

or 

  RSiteSearch(logit)

would provide you with the ability to do keyword searches of your
current R installation or the online e-mail list and documentation
archives, respectively.

You should also review Chapter 11 - Statistical Models in R in An
Introduction to R, which is installed with R or available online under
the Documentation/Manuals link on the main R web site.

HTH,

Marc Schwartz

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


Re: [R] Binary Logit Regression with R

2005-09-29 Thread Ko-Kang Kevin Wang
Hi,

Johann Park wrote:

 Let say, my Y is war occurence (occur=1, otherwise 0). And my independent 
 variables (Xs) are trade, democracy, military poweretc. 

Take a look at ?glm.

HTH,

Kev

-- 
Ko-Kang Kevin Wang
PhD Student
Centre for Bioinformation Science
Building 27, Room 1004
Mathematical Sciences Institute (MSI)
Australian National University
Canberra, ACT 2601
Australia

Homepage: http://wwwmaths.anu.edu.au/~wangk/
Ph (W): +61-2-6125-2431
Ph (H): +61-2-6125-7488
Ph (M): +61-40-451-8301

__
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] Display values in piechart/barplot

2005-09-29 Thread Jim Lemon
Volker Rehbock wrote:
 Is it possible to automatically display the underlying values of a 
 piechart/barplot in the graphic? If so, which package/function/argument do I 
 need for it?

floating.pie and pie.labels in the plotrix package.

Jim

__
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] reshaping data?

2005-09-29 Thread Jim Lemon
Karin Lagesen wrote:
 I have a file like this:
 
 
 a   0.1
 a   0.2
 a   0.9
 b   0.5
 b   0.9
 b   0.7
 c   0.6
 c   0.99
 c   0.88
 
 Which I would like to get to be the following matrix:
 
   0.1 0.20.30.4  ...  
 a 12 0   0 
 b 00 0   0 
 ..
 
If you have a file named KL.dat with the above data in it:

KL.df-read.table(KL.dat,header=FALSE)
KL.mat-as.matrix(table(KL.df))

Jim

__
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] standard error of variances and covariances of the random effects with LME

2005-09-29 Thread Roel de Jong
Well I finally figured it out. If you use the delta method with 
transformations exp(x) for the standard deviations and 
((exp(y)-1)/(exp(y)+1) for the correlation elements of the apVar 
structure, which is btw *not* the inverse of a fisher transformation, 
you get the standard errors.


Douglas Bates wrote:
 With lme you could but it would take a while to work it out.  There is
 an approximate Hessian matrix for the parameters that determine the
 variance-covariance matrix in there somewhere and if you were
 sufficiently persistent you could convert that apVar component to the
 scale of the variances and covariances.  I believe it is in the scale
 of the logarithm of the standard deviation and Fisher's z
 transformation (i.e. the hyperbolic arc tangent) of the correlation.
 
 On 9/29/05, Doran, Harold [EMAIL PROTECTED] wrote:
 
You cannot. Also, it's not that the distribution of the random effects
is not symmetric, but that it *may* not be symmetric, and this is an
assumption that should be checked.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Roel de Jong
Sent: Thursday, September 29, 2005 9:20 AM
To: r-help@stat.math.ethz.ch
Subject: [R] standard error of variances and covariances of the random
effects with LME

Hello,

how do I obtain standard errors of variances and covariances of the
random effects with LME comparable to those of for example MlWin? I know
you shouldn't use them because the distribution of the estimator isn't
symmetric blablabla, but I need a measure of the variance of those
estimates for pooling my multiple imputation results.

Regards,
   Roel.

__
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] mvtnorm package

2005-09-29 Thread Caio Lucidius Naberezny Azevedo
Hi all,
 
I've been trying to install the mvtnorm package (in a Linux R version) 
without sucess. I write
 
install.packages(mvtnorm,lib=/home/posmae/cnaber,repos=http://cran.uk.r-project.org/;)


and the following message arises
 
 
==
downloaded 160Kb
* Installing *source* package 'mvtnorm' ...
** libs
g77   -fPIC  -g -O2 -c mvt.f -o mvt.o
gcc -I/usr/lib/R/include -fPIC  -g -O2 -c randomF77.c -o randomF77.o
gcc -shared  -o mvtnorm.so mvt.o randomF77.o  -lg2c -lm -lgcc_s 
-L/usr/lib/R/lib -lR
/usr/bin/ld: cannot find -lg2c
collect2: ld returned 1 exit status
make: ** [mvtnorm.so] Erro 1
ERROR: compilation failed for package 'mvtnorm'
** Removing '/home/posmae/cnaber/mvtnorm'
** Restoring previous '/home/posmae/cnaber/mvtnorm'
The downloaded packages are in
/tmp/Rtmp25z35w/downloaded_packages
warning message:
installation of package 'mvtnorm' had non-zero exit status in: 
install.packages(mvtnorm, lib = /home/posmae/cnaber, repos = 
http://cran.uk.r-project.org/;) 

 
I don't know what's the problem because I've installed the package sn with 
sucess
 
Thanks all,
 
Caio
 
 
 


-

[[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] Code to read a SAS file

2005-09-29 Thread Miguel de la Hoz
Hi,
 
It is possible you provide me the code to read a SAS file in R.
 
I tried the read.ssd but I didn't get very well on it.
 
Many thanks.
 
M.


-


Comprueba qué es nuevo, aquí

[[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] mvtnorm package

2005-09-29 Thread Dirk Eddelbuettel

On 30 September 2005 at 01:55, Caio Lucidius Naberezny Azevedo wrote:
| ==
| downloaded 160Kb
| * Installing *source* package 'mvtnorm' ...
| ** libs
| g77   -fPIC  -g -O2 -c mvt.f -o mvt.o
| gcc -I/usr/lib/R/include -fPIC  -g -O2 -c randomF77.c -o randomF77.o
| gcc -shared  -o mvtnorm.so mvt.o randomF77.o  -lg2c -lm -lgcc_s 
-L/usr/lib/R/lib -lR
| /usr/bin/ld: cannot find -lg2c


That's the error. 

If you're on Debian, you need libg2c0-dev. But on Debian you may as just
install the existing binary package r-cran-mvtnorm.

If you're not on Debian you need to figure out where to get the complete set
of your libg2c tools from.

| I don't know what's the problem because I've installed the package sn with 
sucess

Sn may not contain fortran sources.

Dirk

-- 
Statistics: The (futile) attempt to offer certainty about uncertainty.
 -- Roger Koenker, 'Dictionary of Received Ideas of Statistics'

__
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