[R] dot diagram

2006-04-09 Thread Jinsong Zhao
Hi, I am wondering whether there is a function that could plot a dot diagram like the output of following code. Thanks in advance! Best wishes! Jinsong -my dirty code here- mydata - c(26,26,27,27,27,27,28,28,28,28,28,28,28,28,28,

Re: [R] copying and pasting to R in linux

2006-04-09 Thread Larry Howe
Louis, OK, I don't use any GUI, just the command line. Everything works fine on the command line. I had the same problem with downloaded Suse 10. It doesn't contain all the same packages that the purchased version does. You have to do Yast / Installation Source and add installation sources.

Re: [R] (IT WAS) Aggregating an its series

2006-04-09 Thread vittorio
Thanks for the brilliant solution. ***AGAIN*** Now - just to go deeper into the **same subject** on which I'm really supposed to work very soon - if I want to aggregate by date only data, say, before noon (12.00.00) what should I do? Ciao Vittorio Alle 16:13, venerdì 07 aprile 2006, Whit

[R] type converters not being saved to workspace

2006-04-09 Thread Joseph Wang
Any one can explain why this happens or any work arounds? setClass('foo') [1] foo setAs('foo', 'character', function(from) from) showMethods('coerce') Function coerce: from = ANY, to = array from = ANY, to = call from = ANY, to = character from = ANY, to = complex from = ANY, to = environment

Re: [R] Boxplot using Formula

2006-04-09 Thread Dieter Menne
Matt Goff goff at nawwal.org writes: The problem is that boxplot is displaying groups that are empty in the plot. Call factor() again on the groups, which will drop levels. You can do that in an extra line, or on-the-fly: data-data.frame(values=c(1:25), groups=rep(c(A,B,C,D,E),

Re: [R] dim(x) error message in lme (nlme package)

2006-04-09 Thread Dieter Menne
Andreas Svensson andreas.svensson at bio.ntnu.no writes: I had a suspicion that you can't have the lme4 package loaded when using lme (from the nlme package), and lo! I get the full summary of lme only if lme4 is NOT loaded. Yes, currently the two don't coexist well, so better make sure

Re: [R] Multiple ablines

2006-04-09 Thread Dieter Menne
G. Alex Janevski galexski at umich.edu writes: points(y~x, pch=*, col=black) lm(y~x) fm=lm(y~x) abline(fm, col=red) This works. The problem arises in that I would like to run my simulation multiple times, to plot the data points together on the same plot, and more importantly the

Re: [R] type converters not being saved to workspace

2006-04-09 Thread Prof Brian Ripley
It is recommended that you use a package for this sort of thing. When a package is loaded, the S4 methods it contains are merged into the metadata. When the global environment is loaded, they are not. Call 'cacheMetaData(1)' to do so. [This looks like a bug: cacheMetaData is called on

Re: [R] Boxplot using Formula

2006-04-09 Thread Sundar Dorai-Raj
Matt Goff wrote: I am trying to use the formula interface for the boxplot. Currently running R 2.2.1 on Windows XP. The problem is that boxplot is displaying groups that are empty in the plot. The following example demonstrates what it is happening (though my actual situation is a

[R] Primitives

2006-04-09 Thread Diethelm Wuertz
How one can make a list of all functions in R's base package which are given as Primitives like abs, sqrt cumsum (but not log) ? Thanks a lot Diethelm Wuertz __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE

Re: [R] R-help Digest, Vol 38, Issue 9

2006-04-09 Thread isaac . martin
Mi nueva dirección de correo es: [EMAIL PROTECTED] New e-mail address: [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] Primitives

2006-04-09 Thread Duncan Murdoch
On 4/9/2006 5:46 AM, Diethelm Wuertz wrote: How one can make a list of all functions in R's base package which are given as Primitives like abs, sqrt cumsum (but not log) ? There's an is.primitive() test function; you just need to get all objects, and test them one by one. Duncan Murdoch

Re: [R] cross product

2006-04-09 Thread Antonio, Fabio Di Narzo
2006/4/8, He, Yulei [EMAIL PROTECTED]: Hi, there. How do I calculate the cross-product in the form of \sum_{i=1}^{n}X_{i}^{t} \Sigma X_{i} using R code without using do loop? X_{i} is the covariate matrix for subject I, \Sigma is the covariance matrix. If I don't miss something in the

Re: [R] more documentation on lmer?

2006-04-09 Thread Henrik Parn
Dear Bill, You might check Faraway's 'Extending the Linear Model with R: Generalized Linear, Mixed Effects and Nonparametric Regression Models' (2006). Without having read the book properly, at least I noticed that package lme4 and the function lmer is used in the examples. Best regards,

[R] Calculation of r.squared for linear model with offset

2006-04-09 Thread Ross Darnell
R^2 for a model is usually defined as 1-RSS/TSS where TSS is the SS about the mean and RSS is the residual SS from the model. Consider the model in R z - runif(20) y - z+rnorm(20) my.model - lm(y~offset(z)) summary(my.model)$r.squared Here the RSS is equivalent to the TSS and gives 0 when it

Re: [R] dot diagram

2006-04-09 Thread Gabor Grothendieck
Don't know about a function but it can be done in one plot statement like this: plot(seq(x) - match(x, x) ~ x, list(x = sort(mydata)), xlim=c(25,45), ylab =, yaxt=n, pch=19, frame.plot=FALSE) On 4/9/06, Jinsong Zhao [EMAIL PROTECTED] wrote: Hi, I am wondering whether there is a

[R] adding a row to a matrix

2006-04-09 Thread Tim Smith
Hi All, This is probably a very simple question. I was trying to add a row to the rows in a matrix. For example: a - matrix(1:6,2,3) b - a[1,] print(a) [,1] [,2] [,3] [1,]135 [2,]246 print(b) [1] 1 3 5 I now want to add 'b' to every row of 'a',

Re: [R] RFC: default background on lattice plots (conclusion)

2006-04-09 Thread Deepayan Sarkar
I haven't heard any more comments on this, and R 2.3.0 is almost here, so I'll bring this thread to a close. I have changed the default theme to the old PDF default for all devices (except postscript, which still defaults to color=FALSE) in the latest lattice (part of R-alpha now). It's easy

Re: [R] adding a row to a matrix

2006-04-09 Thread Christos Hatzis
You can try sweep: sweep(a,2,b,+) -Christos -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Tim Smith Sent: Sunday, April 09, 2006 11:28 AM To: r-help@stat.math.ethz.ch Subject: [R] adding a row to a matrix Hi All, This is probably a very simple

[R] configure error

2006-04-09 Thread R. A. L. Carter
*I've been trying for several weeks to install R-2.2.1 on a PC with an AMD Athlon 64 2800*+* processor running Mandriva 2006_64. After unpacking R-2.2.1.tar.gz I ran ./configure. However, configure stopped prematurely with the message *configure:27295: WARNING: gfortran and gcc disagree on

[R] lm$effects in lm()

2006-04-09 Thread Cal Stats
Hi .. lm() returns an effects component in its output. I read the explanation in R but was not quite clear. say my response is Y and design matrix is X say X has QR decomposition X=QR is effects = Q (Q'Q)^-1 Q' Y ??? i am sure this is wrong as it did not match the

Re: [R] configure error

2006-04-09 Thread Larry Howe
On Sunday 09 April 2006 11:41, R. A. L. Carter wrote: prematurely with the message *configure:27295: WARNING: gfortran and gcc disagree on int and double configure:27297: error: Maybe change CFLAGS or FFLAGS?* Altough I've looked in both the R_Help archive and This is primarily a guess, but

[R] logistic regression model with non-integer weights

2006-04-09 Thread Ramón Casero Cañas
When fitting a logistic regression model using weights I get the following warning data.model.w - glm(ABN ~ TR, family=binomial(logit), weights=WEIGHT) Warning message: non-integer #successes in a binomial glm! in: eval(expr, envir, enclos) Details follow *** I have a binary dependent

Re: [R] adding a row to a matrix

2006-04-09 Thread Gabor Grothendieck
Try this: t(t(a)+b) On 4/9/06, Tim Smith [EMAIL PROTECTED] wrote: Hi All, This is probably a very simple question. I was trying to add a row to the rows in a matrix. For example: a - matrix(1:6,2,3) b - a[1,] print(a) [,1] [,2] [,3] [1,]135 [2,]246

[R] using latex() function with other .sty files

2006-04-09 Thread Brian Quinif
I am having some problems using the latex() function in the Hmisc package. When I turned on the ctable option in latex(), the LaTeX code produced by latex()somehow conflicts with the style back my unversity uses for theses. Has anyone on the list had a similar conflict and been able to fix it.

Re: [R] (IT WAS) Aggregating an its series

2006-04-09 Thread Whit Armstrong
Just strip off the hours component of the dates, then take a subset of the data where the hour is = 12. I did not execute this, so you might need to change it a bit: hours - as.integer(format(dates(base),%H)) new.data - base[hours = 12,]

Re: [R] adding a row to a matrix

2006-04-09 Thread Tim Smith
Thanks Christosworked a treat! Christos Hatzis [EMAIL PROTECTED] wrote: You can try sweep: sweep(a,2,b,+) -Christos -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Tim Smith Sent: Sunday, April 09, 2006 11:28 AM To: r-help@stat.math.ethz.ch

[R] help on using 'sum' in writng a function

2006-04-09 Thread skim033
Hi, I am writing a function that includes 'sum' function such as: f-function(x){ c-c(-1,0,1) f-sum(c+x) } expecting f to be -1+x+0+x+1+x=3x. But I found out that f is sum(x). So, f is always a scalar, which means that f(c(0,1)) is not a vector as c(0,3), but 3(0+1)=3. I would like to ask you

Re: [R] help on using 'sum' in writng a function

2006-04-09 Thread Gabor Grothendieck
If c is c(c1, c2, c3) and x is c(x1, x2, x3) then c+x is (c1+x1, c2+x2, c3+x3) so sum(c+x) is c1+x1+c2+x2+c3+x3 = sum(c) + sum(x) What you were expecting is given by: rowSums(outer(1:4, c(-1,0,1), +)) # gives c(3, 6, 9, 12) Review the Introduction to R manual and also look at ?outer and

Re: [R] help on using 'sum' in writng a function

2006-04-09 Thread Gabor Grothendieck
Or, of course, if you are willing to reduce it then its just sum(c) + length(c) * x On 4/9/06, Gabor Grothendieck [EMAIL PROTECTED] wrote: If c is c(c1, c2, c3) and x is c(x1, x2, x3) then c+x is (c1+x1, c2+x2, c3+x3) so sum(c+x) is c1+x1+c2+x2+c3+x3 = sum(c) + sum(x) What you were

Re: [R] Primitives

2006-04-09 Thread Diethelm Wuertz
Duncan Murdoch wrote: On 4/9/2006 5:46 AM, Diethelm Wuertz wrote: How one can make a list of all functions in R's base package which are given as Primitives like abs, sqrt cumsum (but not log) ? There's an is.primitive() test function; you just need to Sorry when I ask again, how to

[R] calculation of r (corelation coefficient) from models

2006-04-09 Thread S Nakagawa
Dear R users This is a stats question rather than R question. For continuous predictors, we get estimates of slopes and their se and t values (slope/se) in R ouptput. If we have a model with more than one continuous variable (i.e., multiple regression), we get slope, se and t value for each

Re: [R] Primitives

2006-04-09 Thread Duncan Murdoch
On 4/9/2006 5:57 PM, Diethelm Wuertz wrote: Duncan Murdoch wrote: On 4/9/2006 5:46 AM, Diethelm Wuertz wrote: How one can make a list of all functions in R's base package which are given as Primitives like abs, sqrt cumsum (but not log) ? There's an is.primitive() test function; you just

[R] Re : AUC under spline curve

2006-04-09 Thread ssim
Dear R list, I have fitted cubic regression spline with fixed degree of freedom to a set of data using package mgcv. Now I want to calculate the area under the spline curve. Someone has suggested me to use trapezoidal rule. Do you know if someone has written a package that will carry out that

[R] SE estimates for treatment groups from nlme

2006-04-09 Thread Katherine A Grieve
I am wondering how to obtain SE estimates for fixed effects from a nonlinear mixed effects model? I have fixed effects corresponding to three factors A, B and C with 2, 3 and 3 levels respectively. I have fit a model of the following general form: nlme1-nlme(y~ SasympOrig(x, Asym, lrc),

[R] help on using sum in writng a function again

2006-04-09 Thread skim033
Hi, thanks for your reply. Here I would like to ask you again more directly. The following is what I had for now. The function to begin with is dnorm(theta+2*pi*j,0,1)*(pnorm(((2*pi*(k+1)-rho* (theta+2*pi*j)). Now, I wanted to sum it over k from -1 to 1. So, I wrote the following.

[R] weighted kernel density estimate

2006-04-09 Thread Adrian Baddeley
Weighted spatial kernel density estimation is available in the function 'density.ppp' in the package 'spatstat'. __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide!

[R] passing known medoids to clara() in the cluster package

2006-04-09 Thread Dylan Beaudette
Greetings, I have had good success using the clara() function to perform a simple cluster analysis on a large dataset (1 million+ records with 9 variables). Since the clara function is a wrapper to pam(), which will accept known medoid data - I am wondering if this too is possible with

[R] [Help] a Correlation Problem

2006-04-09 Thread kenzy ken
I encounter a statistic problem about correlation. I use R to test wether two variables are correlated or not. (pearson correlation) cor.test(x,y) give a p=5.87 Because the x, y is not normal distributed (qqplot indicate that) I also perform (spearman

Re: [R] [Help] a Correlation Problem

2006-04-09 Thread Gabor Grothendieck
Try this where g is f summed over j and k for given scalars theta and rho and gv is g vectorized over theta. I have not checked this carefully so be sure you do: f - function(theta = 0, rho = 0, j = 0, k = 0) dnorm(theta+2*pi*j,0,1)*pnorm(2*pi*(k+1)-rho*(theta+2*pi*j)) g - function(theta

Re: [R] help on using sum in writng a function again

2006-04-09 Thread Gabor Grothendieck
Sorry, I replied to the wrong email. Here it is again: Try this where g is f summed over j and k for given scalars theta and rho and gv is g vectorized over theta. I have not checked this carefully so be sure you do: f - function(theta = 0, rho = 0, j = 0, k = 0)

[R] Generic code for simulating from a distribution.

2006-04-09 Thread matgopa1
Hello all, I have the code below to simulate samples of certain size from a particular distribution (here,beta distribution) and compute some statistics for the samples. betasim2-function(nsim,n,alpha,beta) { sim-matrix(rbeta(nsim*n,alpha,beta),ncol=n) xmean-apply(sim,1,mean)

[R] interlogistic regression-interactive parameters

2006-04-09 Thread orkun
hello I wonder if anyone can tell me the logic of using of interactive parameters in logistic regression ? (or direct me any link containing explaining it) kind regards Ahmet Temiz -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be