Re: [R] Inversion function of dnorm ?

2005-11-24 Thread Martin Maechler
Huang-Wen == Huang-Wen Chen [EMAIL PROTECTED] on Thu, 24 Nov 2005 02:51:18 -0500 writes: Huang-Wen Hi, Huang-Wen In R, qnorm is the inversion function of pnorm. (c.d.f) Huang-Wen But there is no inversion function for dnorm. (p.d.f). Huang-Wen Is there any easy (and quick)

[R] AIC in lmer when using PQL

2005-11-24 Thread Elizabeth Boakes
I am analysing binomial data using a generalised mixed effects model. I understand that if I use glmmPQL it is not appropriate to compare AIC values to obtain a minimum adequate model. I am assuming that this means it is also inappropriate to use AIC values from lmer since, when analysing

[R] source code

2005-11-24 Thread Kuba
Hi, I cannot find source code of package stats. Do you know where I can find it? Regards Jakub Kalarus Andrzejki - wróżby tylko dla pań! Katarzynki - wróżby tylko dla kawalerów! Sprawdź - zanim będzie za późno ;)

[R] How to save an object list as txt?

2005-11-24 Thread Antje Döring
Hello everyone, does somebody know how can I save an object list as a txt-file or as a csv-file? The problem is, that the elements of this list have different row length. So I cannot convert the list into a matrix or something else and then use write-matrix or so as usual. Thank you

[R] Survreg Weibull lambda and p

2005-11-24 Thread Stephen
Hi All, I have conducted the following survival analysis which appears to be OK (thanks BRipley for solving my earlier problem). surv.mod1 - survreg( Surv(timep1, relall6)~randgrpc, data=Dataset, dist=weibull, scale = 1) summary(surv.mod1) Call: survreg(formula = Surv(timep1,

Re: [R] AIC in lmer when using PQL

2005-11-24 Thread Dimitris Rizopoulos
note that although PQL is the default method in lmer() for GLMMs, the recent version of the function allow also for Laplace or adaptive Gauss-Hermite approximations. In these cases it might be reasonable to compute AIC values depending on how good the approximation to the likelihood is;

Re: [R] source code

2005-11-24 Thread Chuck Cleland
https://svn.r-project.org/R/trunk/src/library/stats/ Kuba wrote: Hi, I cannot find source code of package stats. Do you know where I can find it? Regards Jakub Kalarus Andrzejki - wróżby tylko dla pań! Katarzynki - wróżby tylko

[R] hamming distance

2005-11-24 Thread Ana Conesa
Hi, Does anyone know an R function to impute hamming distance? Thanks Ana O@ nb @@@O@@O@ Centro de Genómica @OO@ Instituto Valenciano de Investigaciones Agrarias (IVIA) @@@O Carretera Moncada - Naquera, Km. 4,5 O@46113 Moncada

[R] Chi-squared test

2005-11-24 Thread Bianca Vieru- Dimulescu
Hello, I'm trying to calculate a chi-squared test to see if my data are different from the theoretical distribution or not: chisq.test(rbind(c(79, 52, 69, 71, 82, 87, 95, 74, 55, 78, 49, 60),c(80,80,80, 80, 80, 80, 80, 80, 80, 80, 80, 80))) Pearson's Chi-squared test data: rbind(c(79,

Re: [R] Crop white border for PDF output

2005-11-24 Thread Stephen Eglen
Claus Atzenbeck writes: On Tue, 22 Nov 2005, Marc Schwartz wrote: The disadvantage with pdfcrop is that it takes an additional step: First, I have to produce the diagrams, then, I have to call pdfcrop on them to crop the white space. pdfcrop does a perfect job here: It crops the

[R] Suggested add to the documentation for the identify() function

2005-11-24 Thread Vivek Satsangi
Folks, 1. Is there a more appropriate list (r-devel?) for posting such suggestions? I am a newbie to R, and doubtless will have some suggestions for the documentation -- some good, others not quite so. I would actually like to help give back to the community (I was motivated by Prof. Ripley's

[R] what's the meaning of these in R-lang?

2005-11-24 Thread ronggui
In this case the environment contains the variables local to the function, and its enclosure is the environment of the enclosing function.(R-lang:p11) I want to know if the enclosing function means the closure of the function? for example ,if I call function mean(),and the create an

Re: [R] Chi-squared test

2005-11-24 Thread P Ehlers
Bianca Vieru- Dimulescu wrote: Hello, I'm trying to calculate a chi-squared test to see if my data are different from the theoretical distribution or not: chisq.test(rbind(c(79, 52, 69, 71, 82, 87, 95, 74, 55, 78, 49, 60),c(80,80,80, 80, 80, 80, 80, 80, 80, 80, 80, 80)))

[R] data frames and factors

2005-11-24 Thread Arne.Muller
Hello, I have prepared an svm on some training data and would like to use the svm model for predicting binary outcome from new data. The input data frame contains several numeric and factor variables. Usually I construct the input matrix of the entities to be predicted with a perl script that

Re: [R] Survreg Weibull lambda and p

2005-11-24 Thread Ales Ziberna
Firstly, I assume that your variable is a numeric one. For seperat values p and lambda for diferent categories, you should convert it to factor. However, this has no effect in your case, since you have only 2 categories. You can have only one p and lambda for a variable with only 2 values. The

[R] spatial-time smoothing

2005-11-24 Thread Andrea Aimi
Hi all, I'm looking for to interpolate hourly temperature date collected from more than 140 automatic weather station (irregularly spaced) using 4 independent variable: 1-2) geografic coordinates (x,y) (from DEM - 40m) 3) altitude (z) (from DEM - 40m) 4) solar radiation (from a model calculated

Re: [R] finding peaks in a simple dataset with R

2005-11-24 Thread Petr Pikal
Hi Marc I use this function for finding maxima in some spectral data (eg. from Xray diffraction) and it satisfied my needs. The function itself was modified probably due to some reasons for ploting my data so it dropped values from the end rather than from both sides. Peaks in those cases

Re: [R] what's the meaning of these in R-lang?

2005-11-24 Thread Peter Dalgaard
ronggui [EMAIL PROTECTED] writes: In this case the environment contains the variables local to the function, and its enclosure is the environment of the enclosing function.(R-lang:p11) Page number are of dubious value for documents in multiple formats. It is page 5 in the PDF version on CRAN!

Re: [R] R: pp plot

2005-11-24 Thread Dr. Herwig Meschke
To construct a nonparametric (1-alpha) confidence set for an arbitrary CDF F, you can use the Dvoretzky-Kiefer-Wolfowitz (DKW) inequality (e.g., see Wasserman, L. (2005). All of Statistics. 2nd, corr. printing. NY: Springer, p. 99). With n=sample size and eps=sqrt(log(2/alpha)/(2*n)), the lower

Re: [R] Chi-squared test

2005-11-24 Thread Vito Ricci
Hi Bianca, you could see my contribute Fitting distribution with R, pagg. 16-18: http://cran.r-project.org/doc/contrib/Ricci-distributions-en.pdf Hoping it could help you. Regards, Vito From: Bianca Vieru- Dimulescu bianca.vieru at free.fr Subject: [R] Chi-squared test Date: 2005-11-24

Re: [R] Survreg Weibull lambda and p

2005-11-24 Thread Stephen
Hi Ales, Thanks I had tried converting randgrpc previously to a factor - still didn't get the effect for the different groups. Weird - do you think not getting different effects for each group might have to do with tidying up tmp files and the like? I have had tmp file issues with well known

Re: [R] finding peaks in a simple dataset with R

2005-11-24 Thread Martin Maechler
Gabor == Gabor Grothendieck [EMAIL PROTECTED] on Wed, 23 Nov 2005 16:51:17 -0500 writes: Gabor One idea might be, rather than have a peaks function, enhance Gabor rle so that it optionally produces a third component with the Gabor peak information, perhaps 1, 0, -1 for peak,

Re: [R] Survreg Weibull lambda and p

2005-11-24 Thread Stephen
Hi Ales, Sorry Mis-read your posting - I blindly saw 'no effect' and was thrown - so its like a dummy regression you loose 1 category I can conclude that p of randgrp is 1.47e-04 or 0.000147 which is a significant difference between the groups? Sorry this is the first time I have done this.

Re: [R] what's the meaning of these in R-lang?

2005-11-24 Thread ronggui
Thanks very much. ronggui [EMAIL PROTECTED] writes: In this case the environment contains the variables local to the function, and its enclosure is the environment of the enclosing function.(R-lang:p11) Page number are of dubious value for documents in multiple formats. It is page 5 in the

Re: [R] hamming distance

2005-11-24 Thread JeeBee
You could install.packages(e1071) and see help(hamming.distance) JeeBee. hamming.distancepackage:e1071R Documentation Hamming Distances of Vectors Description: If both 'x' and 'y' are vectors, 'hamming.distance' returns the Hamming distance (number of different

[R] font size in legend

2005-11-24 Thread [EMAIL PROTECTED]
Hy all I use barplot to draw frequencies by dates. On the x axis it shows only 1 date for 2 bars, i've understand why, because R cant put so much date on the same axis, it will get out of the graph. that's why i tought about reducing the size of the font used to stamp the x axis. anyone

[R] Matrix rotation

2005-11-24 Thread Benjamin Lloyd-Hughes
Dearest All, Ok so I've had a couple of glasses of wine over lunch today... This is likely to be trivial but I'm struggling to find a more elegant way to obtain the following matrix rotations: M - matrix(c(1,0,0,0), ncol=2) M [,1] [,2] [1,]10 [2,]00 N -

[R] type III sums of squares in R

2005-11-24 Thread Stefanie von Felten, IPWIfU
Hi everyone, Can someone explain me how to calculate SAS type III sums of squares in R? Not that I would like to use them, I know they are problematic. I would like to know how to calculate them in order to demonstrate that strange things happen when you use them (for a course for example). I

[R] Fwd: Matrix rotation

2005-11-24 Thread Benjamin Lloyd-Hughes
Ok I warned you that I'd been drinking! What I really meant was something to go from: [,1] [,2] [1,]12 [2,]43 to [,1] [,2] [1,]41 [2,]32 to [,1] [,2] [1,]34 [2,]21 to [,1] [,2] [1,]23 [2,]14 Sorry for

Re: [R] finding peaks in a simple dataset with R

2005-11-24 Thread Gabor Grothendieck
On 11/24/05, Martin Maechler [EMAIL PROTECTED] wrote: NA's have the big drawback of producing a logical vector that can NOT be used for subsetting -- and subsetting was exactly a main reason for the padding... Since 'which' throws away NAs, one extra 'which' can solve that. In the

Re: [R] hamming distance

2005-11-24 Thread Carlos J. Gil Bellosta
True, but if x - c(1, 0, 0) y - c(1, 0, 1), then you can just define hamming.distance - function(x,y){ sum(x != y) } The problem is just a bit harder when x and y are, for instance, strings. Carlos J. Gil Bellosta http://www.datanalytics.com Quoting JeeBee [EMAIL PROTECTED]:

Re: [R] font size in legend

2005-11-24 Thread Uwe Ligges
[EMAIL PROTECTED] wrote: Hy all I use barplot to draw frequencies by dates. On the x axis it shows only 1 date for 2 bars, i've understand why, because R cant put so much date on the same axis, it will get out of the graph. that's why i tought about reducing the size of the font used

Re: [R] Suggested add to the documentation for the identify() function

2005-11-24 Thread Gabor Grothendieck
On 11/24/05, Vivek Satsangi [EMAIL PROTECTED] wrote: motivated by Prof. Ripley's 2001 talk in which he had commented that open source software users rarely give back anything.) -- but I know With 600+ addon packages this does not seem to be the case for R.

Re: [R] type III sums of squares in R

2005-11-24 Thread Peter Dalgaard
Stefanie von Felten, IPWIfU [EMAIL PROTECTED] writes: Hi everyone, Can someone explain me how to calculate SAS type III sums of squares in R? Not that I would like to use them, I know they are problematic. I would like to know how to calculate them in order to demonstrate that strange

Re: [R] type III sums of squares in R

2005-11-24 Thread Mike Sears
If you use the Anova function in the car package and specify contr.sum or contr.SAS for the contrasts for your categorical factors, you will get the same results as outputted by SAS. I've tried this with a variety of data sets and it works. On Thu November 24 2005 08:27, Stefanie von Felten,

[R] SPSS-like factor analysis procedure

2005-11-24 Thread Ashish Ranpura
[Apologies if this posting is appears twice -- I think I was unsuccessful in posting it previously.] I've read through many postings about principle component analysis in the R-help archives, but haven't been able to piece together the information I need. I'd like to recreate an SPSS-like

Re: [R] type III sums of squares in R

2005-11-24 Thread John Fox
Dear Stefanie and Mike, To elaborate slightly on Mike's points, the Anova() function in car calculates Type-III (and Type-II) tests differently from SAS. (The difference originates in the fact that SAS uses a deficient-rank parametrization of the model while R uses a full-rank parametrization; it

[R] read.list()

2005-11-24 Thread Leaf Sun
Hi all, I need to write and read a list in R. I did r.site.search, found there is a package rmutil doing this, unfortunately it is not on the list of package. In another words, I can't install it from any CRAN mirror. Anybody has idea about this? or any suggestion about the list? Thanks!

Re: [R] Fwd: Matrix rotation

2005-11-24 Thread Gabor Grothendieck
Try this: # cyclically rotate a vector to the right rot - function(x) c(x[length(x)], x[-length(x)]) # create a vector from a 2x2 matrix moving left to right along # first row and then right to left along second row m2v - function(m) m[c(1,3,4,2)] # inverse of m2v. Note that c(1,4,2,3) equals

[R] residuals in logistic regression model

2005-11-24 Thread Urania Sun
In the logistic regression model, there is no residual log (pi/(1-pi)) = beta_0 + beta_1*X_1 + . But glm model will return residuals What is that? How to understand this? Can we put some residual in the logistic regression model by replacing pi with pi' (the estimated pi)? log

Re: [R] R: pp plot

2005-11-24 Thread Kjetil Brinchmann Halvorsen
Dr. Herwig Meschke wrote: To construct a nonparametric (1-alpha) confidence set for an arbitrary CDF F, you can use the Dvoretzky-Kiefer-Wolfowitz (DKW) inequality (e.g., see Wasserman, L. (2005). All of Statistics. 2nd, corr. printing. NY: Springer, p. 99). With n=sample size and

[R] JOB: R/S Consultants, Reading (UK)

2005-11-24 Thread Rich
Mango Solutions, providers of R and S-PLUS consulting, development and training Services, are looking for 2 consultants to join their UK-based technical team. We are looking for highly motivated individuals to work in a customer-focused environment. R/S Pharmaceutical Consultant (Reading, UK)

Re: [R] residuals in logistic regression model

2005-11-24 Thread John Fox
Dear Urania, The residuals method for glm objects can compute several kinds of residuals; the default is deviance residuals. See ?residuals.glm for details and references. I hope this helps. John John Fox Department of Sociology McMaster University Hamilton,

[R] model selection with step function

2005-11-24 Thread Antonio Olinto
Hello, I have a doubt in using the function step (step wise) to select glm models. Usually I apply the gamma distribution to analyze fishery data. To select the terms I use a routine where I first compare single term models to the null model (eg. U~1 vs. U~depth; U~1 vs. U~latitude; etc. – where

Re: [R] Chi-squared test

2005-11-24 Thread Ted Harding
On 24-Nov-05 P Ehlers wrote: Bianca Vieru- Dimulescu wrote: Hello, I'm trying to calculate a chi-squared test to see if my data are different from the theoretical distribution or not: chisq.test(rbind(c(79,52,69,71,82,87,95,74,55,78,49,60),

Re: [R] Fwd: Matrix rotation

2005-11-24 Thread Gabor Grothendieck
In thinking about this a bit more it can be simplified to the following where f takes a 2x2 matrix as its first argument and permutes it according to the second argument returning the permuted 2x2 matrix: f - function(m = c(1,4,2,3), idx = c(2,4,1,3)) matrix(m[idx],2) print(m - f(,1:4)) for(i in

Re: [R] model selection with step function

2005-11-24 Thread P Ehlers
Antonio Olinto wrote: Hello, I have a doubt in using the function step (step wise) to select glm models. Usually I apply the gamma distribution to analyze fishery data. To select the terms I use a routine where I first compare single term models to the null model (eg. U~1 vs. U~depth;

[R] How to test a time series fit the Poisson or other process?

2005-11-24 Thread 广星
Hi, R-Help, I am a newbie. what I concern most recently is the analysis of the time series, But there are a lot of package in my eyes. All I want to try is as follow: How to test whether a time series fit the Poisson or other process in R? Thank you very much in advance. [EMAIL PROTECTED]   

Re: [R] Chi-squared test

2005-11-24 Thread Marc Schwartz
On Thu, 2005-11-24 at 21:55 +, Ted Harding wrote: On 24-Nov-05 P Ehlers wrote: Bianca Vieru- Dimulescu wrote: Hello, I'm trying to calculate a chi-squared test to see if my data are different from the theoretical distribution or not:

Re: [R] Chi-squared test

2005-11-24 Thread Peter Dalgaard
(Ted Harding) [EMAIL PROTECTED] writes: On 24-Nov-05 P Ehlers wrote: Bianca Vieru- Dimulescu wrote: Hello, I'm trying to calculate a chi-squared test to see if my data are different from the theoretical distribution or not: chisq.test(rbind(c(79,52,69,71,82,87,95,74,55,78,49,60),

Re: [R] Chi-squared test

2005-11-24 Thread P Ehlers
Marc Schwartz wrote: On Thu, 2005-11-24 at 21:55 +, Ted Harding wrote: On 24-Nov-05 P Ehlers wrote: Bianca Vieru- Dimulescu wrote: Hello, I'm trying to calculate a chi-squared test to see if my data are different from the theoretical distribution or not:

Re: [R] residuals in logistic regression model

2005-11-24 Thread Urania Sun
Thanks, Professor. But is it ok to write residuals in the right hand side of the logistic regression formula? Some people said I cannot since the generalized linear model is to use a function to link the expectation to a linear model. So there should not be residuals in the right hand side. My

Re: [R] adding variables to a data set/combining two data sets

2005-11-24 Thread Marc Schwartz
On Wed, 2005-11-23 at 16:13 -0700, nhepburn wrote: I have a couple of data sets that I want to combine into one data frame. One set contains a number of records on individual observations and includes a geographic descriptor called dacode. The dacode is not unique in that table. The other

Re: [R] residuals in logistic regression model

2005-11-24 Thread John Fox
Dear Urania, -Original Message- From: Urania Sun [mailto:[EMAIL PROTECTED] Sent: Thursday, November 24, 2005 8:52 PM To: John Fox Cc: r-help@stat.math.ethz.ch Subject: Re: [R] residuals in logistic regression model Thanks, Professor. But is it ok to write residuals in the

Re: [R] residuals in logistic regression model

2005-11-24 Thread Urania Sun
Thanks a lot, Professor. Now I know if I put some additive residuals in the right handside of the logistic regression equation, they are different with any glm returned residuals. But is it ever ok or legal to put some additive residuals in the right-hand side of the logistic equation

Re: [R] Chi-squared test

2005-11-24 Thread Marc Schwartz
On Thu, 2005-11-24 at 18:50 -0700, P Ehlers wrote: Marc Schwartz wrote: On Thu, 2005-11-24 at 21:55 +, Ted Harding wrote: On 24-Nov-05 P Ehlers wrote: Bianca Vieru- Dimulescu wrote: Hello, I'm trying to calculate a chi-squared test to see if my data are different from the

[R] (no subject)

2005-11-24 Thread Holger Lutz Kern
Hi all, does anyone know if there exists some library that implements the sensitivity tests for matched pairs and unmatched groups proposed in Rosenbaum's Observational Studies (2002: ch.4)? Cheers, Holger __ R-help@stat.math.ethz.ch mailing list

[R] OT: algorithm for generating all possible combinations with replacement

2005-11-24 Thread Globe Trotter
Dear all, I have n objects and I want to select k of these with replacement. Do you know of code which would generate all the possible arrangements? Note that this is different from the selection of k of n objects without replacement and wanting to generate all the possible permutations. Any

Re: [R] OT: algorithm for generating all possible combinations with replacement

2005-11-24 Thread Kristel Joossens
I think you just need a sample with replacement sample(1:n,k,replace=TRUE) Best regards, Kristel Globe Trotter wrote: Dear all, I have n objects and I want to select k of these with replacement. Do you know of code which would generate all the possible arrangements? Note that this is