Re: [R] Generic code for simulating from a distribution.

2006-04-10 Thread Matthias Kohl
Hi, have a look at the packages distr and distrSim which are on CRAN. hth Matthias - original Nachricht Betreff: [R] Generic code for simulating from a distribution. Gesendet: Mo, 10. Apr 2006 Von: [EMAIL PROTECTED] Hello all, I have the code below to simulate samples of

Re: [R] Primitives

2006-04-10 Thread Prof Brian Ripley
You need ls(all=TRUE) as some (12) are 'dot-names'. I just used foo - ls(package:base, all =TRUE) pr - foo[sapply(foo, function(x) is.primitive(get(x, package:base)))] and got 152. There is a description in the `Writing R Extensions' manual, but it is incomplete, and another classified list

[R] using 'sum' function in writing a function

2006-04-10 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] passing known medoids to clara() in the cluster package

2006-04-10 Thread Martin Maechler
DylanB == Dylan Beaudette [EMAIL PROTECTED] on Sun, 9 Apr 2006 19:28:44 -0700 writes: DylanB Greetings, I have had good success using the clara() DylanB function to perform a simple cluster analysis on a DylanB large dataset (1 million+ records with 9 variables). DylanB

Re: [R] The mysterious e1071

2006-04-10 Thread J Dougherty
On Saturday 08 April 2006 11:51, Chelsea Ellis wrote: Hi, I'm trying to use the svm function in R, but I can't find the e1071 package. When I type library(e1071), I get the error message that the package doesn't exist. I've searched all over the CRAN website, but I can't find anything. Did

[R] some output is missing -- not getting the full anova table

2006-04-10 Thread marilyn ford
I have just started using R and am stumped over something: I am using the lme4 package, using lmer (and putting it in to fit0.lmer ) and then I do an anova, but I am not getting the full table. This is what I get: fit0.lmer - lmer(subj.prob.rev ~ semantic.class + bipron.rec + item.order +

[R] installing problem

2006-04-10 Thread Fred J.
Dear R users a problem I encountered while installing fMultivar, I would appriciate any help with this. install.packages (fMultivar, dependencies=TRUE) Warning in install.packages(fMultivar, dependencies = TRUE) : argument 'lib' is missing: using /usr/local/lib/R/site-library

Re: [R] some output is missing -- not getting the full anova table

2006-04-10 Thread Dieter Menne
marilyn ford m.ford at griffith.edu.au writes: I have just started using R and am stumped over something: I am using the lme4 package, using lmer (and putting it in to fit0.lmer ) and then I do an anova, but I am not getting the full table. This is what I get: fit0.lmer -

Re: [R] SE estimates for treatment groups from nlme

2006-04-10 Thread Dieter Menne
Katherine A Grieve grieve at u.washington.edu writes: I am wondering how to obtain SE estimates for fixed effects from a nonlinear mixed effects model? It's a bit of fiddling, but there is an example coming close to what you want on page 373 of Pinheiro/Bates, and in file

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

2006-04-10 Thread Prof Brian Ripley
On Sun, 9 Apr 2006, Ross Darnell wrote: 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. Not when there is no intercept or where there is an offset in the model. Consider the model in R z - runif(20) y -

Re: [R] using 'sum' function in writing a function

2006-04-10 Thread Dieter Menne
skim033 at student.ucr.edu writes: 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

[R] Legend in the outer margin

2006-04-10 Thread Prasanna
Dear Rs I have a 3x3 multiple plot. I would like to have a overall legend in the outer right margin. From the help archive, I found that it can be done by setting par(xpd=NA). However, I couldn't find the correct values for x and y co-ordinates for the legend. Please find the code snippet below:

[R] Handling of NA ´s in the matrix multiplicati on function

2006-04-10 Thread Fredrik Thuring
Hi! Is there a way of handling NA´s in the matrix multiplication function '%*%'? I cant find anything concerning this in the help files. I´m thinking of some sort of setting such as na.rm=T. Thanks before hand to anyone how can help me! Fredrik Thuring, Junior Business Researcher

[R] Weights in glmmPQL

2006-04-10 Thread Nelson, Kerrie
Hello, I am using the R function glmmPQL to fit a logistic GLMM, with weights. I am finding that I get fairly different parameter estimates in glmmPQL from fitting the full dataset (with no weight statement) and an equivalent, shorter dataset with the weights statement. I am using the weights

[R] how to figure out skewness

2006-04-10 Thread Jian Zhang
I think it is simply, but I cannot find the method to figure out skewness. Thanks! [[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!

Re: [R] how to figure out skewness

2006-04-10 Thread Gabor Grothendieck
RSiteSearch(skewness) On 4/10/06, Jian Zhang [EMAIL PROTECTED] wrote: I think it is simply, but I cannot find the method to figure out skewness. Thanks! [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list

Re: [R] how to figure out skewness

2006-04-10 Thread ronggui
you can transform the variable x down the ladder if it is positive skew (x^0.5,x^ -1...)and up the ladder if x is negative skew ( etc, x^2 ,x^3...). The book An R and S-PLUS Companion To Applied Regression has a section to deal with the data transformation.Especiall P109 is about transformation

[R] Upadating windows shortcuts after upgrade

2006-04-10 Thread Ales Ziberna
Dear R users, I was just wondering, if anybody has a simple solution to the following problem: I have just installed R 2.2.1 next to R 2.1.1 (in different folder, of course) (but the versions do not really matter) on WinXP. I have different R projects in different folders and in each folder, I

Re: [R] Legend in the outer margin

2006-04-10 Thread Uwe Ligges
Prasanna wrote: Dear Rs I have a 3x3 multiple plot. I would like to have a overall legend in the outer right margin. From the help archive, I found that it can be done by setting par(xpd=NA). However, I couldn't find the correct values for x and y co-ordinates for the legend. Please find

Re: [R] Upadating windows shortcuts after upgrade

2006-04-10 Thread Gabor Grothendieck
If you are using XP then create a shortcut to Rgui.bat, which can be found in: http://cran.r-project.org/contrib/extra/batchfiles/ 0.2-7 is the most recent. When you install R it saves in the registry the R version and Rgui.bat looks that up and runs that version thereby giving you the last

Re: [R] Legend in the outer margin

2006-04-10 Thread Dieter Menne
Uwe Ligges ligges at statistik.uni-dortmund.de writes: You get the user coordinates of the plotting region by par(usr) Now simply make the legend right of that plotting region, e.g. with x corrdinates at par(usr)[2] + epsilon and y coordinates at mean(par(usr)[3:4]) I always

[R] fdim questions

2006-04-10 Thread James R. Milks
R-users: My problem: the package fdim (which measures fractal dimensions of datasets) apparently prefers 3-D (XYZ) datasets. I'm trying to measure the information dimension (a type of fractal dimension) of a 2-D (XY) dataset. Here's some examples of the preferred 3-D data (XYZ):

[R] multicomp

2006-04-10 Thread Nair, Murlidharan T
Is there a multicomp() function in R as in S plus? Thanks ../Murli __ 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] TukeyHSDs function (pgirmess package)

2006-04-10 Thread Rune Vejen Petersen
Dear R-help, I have been trying to use the TukeyHSDs function in the pgirmess package to quickly extract all significant pairwise comparisons in an aov object. However, it seems that this function isn't working as intended when only the two last populations means being tested are significant.

[R] regression/step coefficients extraction

2006-04-10 Thread Hufkens Koen
Hi list, I'm looking for a way to easily extract regression p-values and export them to one file for further evaluation. Here is the problem. I use lm() and step() to get my regression parameters/coefficients. after that I can extract them with summary(lm-results)$coefficients[,4] so far so

[R] Fourier / Bandpass filter help?

2006-04-10 Thread Pete Cap
List, I am trying to apply some digital signal analysis methods to IPv4 networks. Specifically, I have had some success using the Fast Fourier Transform in R to find periodic events in IPv4 network traffic by producing periodograms. I store network traffic in a mysql database so I have

Re: [R] Re : AUC under spline curve

2006-04-10 Thread Simon Wood
## simulated data... x - runif(100) y - rnorm(100) ## spline fit... m - gam(y~s(x,k=6,fx=TRUE)) ## trapezoidal integration ... n - 1000 ## number of points in trap. approx pd - data.frame(x=seq(0,1,length=n)) dx - pd$x[2]-pd$x[1] f - predict.gam(m,pd) w - rep(dx,n);w[1]-w[n] - w[2]/2 ##

Re: [R] dot diagram

2006-04-10 Thread Greg Snow
A basic implementation of this is the dots function in the TeachingDemos package. -- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare [EMAIL PROTECTED] (801) 408-8111 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of

[R] SE estimates for treatment groups from nlme

2006-04-10 Thread Katherine A Grieve
I have looked at that example on p. 373, however it still does not help me to get the stand errors i need. In my case, with the 18 different groups, I am combining more than just the (intercept) term with one other row in the Summary tTable. It is no problem to form linear combinations of the

[R] error message explanation for lmer

2006-04-10 Thread Bill Shipley
I am getting the following error message using the lmer function for mixed models with method=Laplace: nlminb returned message false convergence (8) in: LMEopt(x=mer,value=cv) Could anyone explain what this means, and how I might overcome (or track down) the problem? Bill Shipley

Re: [R] Legend in the outer margin

2006-04-10 Thread Greg Snow
The cnvrt.coords function in the TeachingDemos package may be of help. Here is an example of possible use (just change the .9 and .7 to where ever on the page you want the legend): par(mfrow=c(3,3), mar=c(4,4,0.9,0.5), oma=c(1,2,2,4),cex.main=1.1) for (i in 1:9){ x - runif(25,1,10)

Re: [R] SE estimates for treatment groups from nlme

2006-04-10 Thread Christian Ritz
Hi Katie, maybe the easiest solution is to create a new factor that corresponds to the combinations of the three factors A, B and C. A quick and dirty way to create such a factor is: ABC - factor(paste(A, x, B, x, C, sep = )) ABC and then fit the model using the variable ABC instead of A*B*C.

[R] seq

2006-04-10 Thread Omar Lakkis
Can someone, please, help explain to me why the following two calls return the same set: seq(from=as.POSIXlt('2005-12-4'), to=as.POSIXlt('2006-4-2'), by='weeks') [1] 2005-12-04 EST 2005-12-11 EST 2005-12-18 EST 2005-12-25 EST [5] 2006-01-01 EST 2006-01-08 EST 2006-01-15 EST 2006-01-22 EST

Re: [R] seq

2006-04-10 Thread Gabor Grothendieck
Its undoubtedly a timezone or daylight savings time issue. Use this instead: seq(from=as.Date('2005-12-4'), to=as.Date('2006-4-9'), by='weeks') [1] 2005-12-04 2005-12-11 2005-12-18 2005-12-25 2006-01-01 [6] 2006-01-08 2006-01-15 2006-01-22 2006-01-29 2006-02-05 [11] 2006-02-12 2006-02-19

Re: [R] seq

2006-04-10 Thread Thomas Lumley
On Mon, 10 Apr 2006, Omar Lakkis wrote: Can someone, please, help explain to me why the following two calls return the same set: seq(from=as.POSIXlt('2005-12-4'), to=as.POSIXlt('2006-4-2'), by='weeks') [1] 2005-12-04 EST 2005-12-11 EST 2005-12-18 EST 2005-12-25 EST [5] 2006-01-01 EST

[R] Random specification in LMER

2006-04-10 Thread Arnaud Ghilain
Hello, Can anybody help me understand the difference between the three different codes in specifying the slope in the random part of a mixed model using LMER? Here are the codes: (age | id) (1 + age | id) (age - 1 | id) Thank you in advance Arnaud

Re: [R] TukeyHSDs function (pgirmess package)

2006-04-10 Thread Peter Ehlers
Rune Vejen Petersen wrote: Dear R-help, I have been trying to use the TukeyHSDs function in the pgirmess package to quickly extract all significant pairwise comparisons in an aov object. However, it seems that this function isn't working as intended when only the two last populations

[R] writing a data frame using xtable without row names

2006-04-10 Thread Monty B.
Dear all, I am trying to write a data frame / table to a latex table using xtable. The thing is that I do not want to write the row names as not all rows will be named. I have tried writing both a matrix (setting e.g. rownames(mat) - c(a, , )) and a dataframe (setting row.names to a similar

[R] p values for a GEE model

2006-04-10 Thread Tarca, Adi
Hi all, I have a dataset in which the output Y is observed on two groups of patients (treatment factor T with 2 levels). Every subject in each group is observed three times (not time points but just technical replication). I am interested in estimating the treatment effect and take into account

[R] timeAlign

2006-04-10 Thread Omar Lakkis
I use POSIXct for datetimes. Is thee a timeAlign function that I can use where : align by year direction -1 == start of this year direction 1 == start of next year align by week direction -1 == date on last sunday direction 1 == date on next sunday align by day

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

2006-04-10 Thread Dylan Beaudette
Thanks for the reply. On Sunday 09 April 2006 11:46 pm, Martin Maechler wrote: DylanB == Dylan Beaudette [EMAIL PROTECTED] on Sun, 9 Apr 2006 19:28:44 -0700 writes: DylanB Greetings, I have had good success using the clara() DylanB function to perform a simple cluster analysis

[R] Changing character limit in deparse, as.character and toString

2006-04-10 Thread Dave Armstrong
Dear R-help Listers, I am curious if there is some (hopefully easy) way to change the number of characters that can be converted to a single string via any of deparse, as.character or toString. It seems that the limit is 500 for all of these. I saw a previous post where Prof. Ripley suggested

[R] Configure error

2006-04-10 Thread R. A. L. Carter
Hi Folks, I sent this message before but I don't think it got through because I wasn't registered. 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

Re: [R] Reshaping genetic data from long to wide

2006-04-10 Thread Farrel Buchinsky
1) I know how to post to the list. You simply send an e-mail to [EMAIL PROTECTED] But how do you read the items and respond to them? I usually read the items at http://tolstoy.newcastle.edu.au/R/help/06/04/index.html#end and then have to jump through some hoops to answer back. Is there any way to

Re: [R] timeAlign

2006-04-10 Thread Gabor Grothendieck
Try this. dd - Sys.time() # test data lt - as.POSIXlt(dd) ISOdate(1900+lt$year, 1, 1, 0, tz = ) ISOdate(1901+lt$year, 1, 1, 0, tz = ) seq(now, length = 2, by = paste(-, lt$wday, day, sep =))[2] seq(now, length = 2, by = paste(7-lt$wday, day))[2] with(lt, ISOdate(1901+year, mon, mday, 0, tz

Re: [R] Reshaping genetic data from long to wide

2006-04-10 Thread Gabor Grothendieck
On 4/10/06, Farrel Buchinsky [EMAIL PROTECTED] wrote: 1) I know how to post to the list. You simply send an e-mail to [EMAIL PROTECTED] But how do you read the items and respond to them? I usually read the items at http://tolstoy.newcastle.edu.au/R/help/06/04/index.html#end and then have to

Re: [R] timeAlign

2006-04-10 Thread Gabor Grothendieck
On 4/10/06, Gabor Grothendieck [EMAIL PROTECTED] wrote: Try this. dd - Sys.time() # test data lt - as.POSIXlt(dd) ISOdate(1900+lt$year, 1, 1, 0, tz = ) ISOdate(1901+lt$year, 1, 1, 0, tz = ) seq(now, length = 2, by = paste(-, lt$wday, day, sep =))[2] seq(now, length = 2, by =

[R] problems with rounding in output

2006-04-10 Thread Brian Quinif
Perhaps someone will have a solution to my more general problem, but here is the specific one: I used the round() function to round some estimates to 3 decimal places. I then sent put the rounded estimates in a matrix and used latex() to make a LaTeX table from them. However, in my table, there

Re: [R] problems with rounding in output

2006-04-10 Thread Gabor Grothendieck
Try: sprintf((%.2f), pi) [1] (3.14) On 4/11/06, Brian Quinif [EMAIL PROTECTED] wrote: Perhaps someone will have a solution to my more general problem, but here is the specific one: I used the round() function to round some estimates to 3 decimal places. I then sent put the rounded