Re: [R] (robust) mixed-effects model with covariate

2006-08-02 Thread Spencer Graves
What do you get from the following: max(with(df1, table(Subj, Time)))? With cases like this, "lme" gives an answer with a bogus distinction between variance components for "time" and "residuals". I don't know about "aov" or "JMP", but I know that "varcomp" in S-Pl

[R] Error in step()

2006-08-02 Thread Cal Stats
Hi.. I pass a lm() object to step() but after a few steps it stops with the error message. say: x1<-lm(y~.,data=z) x2<-step(x1) i have 516 observations and 299 variables. after a few steps i get the error message: Error in one %*% x : requires numeric matrix/vector arguments

Re: [R] Fitting models in a loop

2006-08-02 Thread Murray Jorgensen
Thanks to all who helped me with this problem, especially Bill Venables and Gabor Grothendieck. I hope one day to learn more about the advanced features of the language used by Bill. From a practical standpoint I think I will just avoid doing things like this in my teaching. It is hard enough

Re: [R] read.spss 'error reading system-file header'

2006-08-02 Thread Michael Bibo
Finn Sandø fs-analyse.dk> writes: > > When I try to import an spss sav file with read.spss() I am getting the > following error > 'Error in read.spss("X:\\.sav") : error reading system-file header' > and the import process is aborted. > I have tried in v. 2.3.0 and 2.3.1 > The sav-file loa

Re: [R] Syntax of Levene's test

2006-08-02 Thread Paul Smith
On 8/3/06, John Fox <[EMAIL PROTECTED]> wrote: > Levene's test tests the null hypothesis that the variance are equal, so a > small p-value suggests that they are not. Looking at your output, it seems > odd that you have as many as 96 groups. Thanks again, John. I have 4 factors with 3, 4, 4 and 2

Re: [R] Syntax of Levene's test

2006-08-02 Thread John Fox
Dear Paul, Levene's test tests the null hypothesis that the variance are equal, so a small p-value suggests that they are not. Looking at your output, it seems odd that you have as many as 96 groups. John John Fox Department of Sociology McMaster University Hamil

Re: [R] ggplot facet label font size

2006-08-02 Thread Gabor Grothendieck
On 8/2/06, Walker, Sam <[EMAIL PROTECTED]> wrote: > How do I change the font size in the facet labels along the edges of the > plot? > > For example (from the ggplot help file): > p<-ggplot(tips, sex ~ smoker, aesthetics=list(x=tip/total_bill)) > gghistogram(p) > > In this plot, the facet l

[R] unbalanced mixed effects models for fully factorial designs

2006-08-02 Thread Murray Logan
Does anyone know of a way of dealing with unbalanced mixed effects (fixed and random factors) for fully factorial designs. An example of such data is given below; The response variable is SQRTRECRUITS SEASON is a random factor DENSITY is a fixed factor Thus DENSITY:SEASON is a fixed factor. The

Re: [R] Finding the position of a variable in a data.frame

2006-08-02 Thread Gerald Jansen
On Wed, 02 Aug 2006 17:12:53 -0400, Chuck Cleland wrote: > Why not do it this way? > > Df$bat <- replace(Df$bat, Df$bat >=50, 100) Is that any different, performancewise, than the following? Df$bat[Df$bat >= 50] <- 100 Gerald Jansen ... John Kane wrote: > Simple example > > cat <- c( 3,5,6,8

[R] Baseline levels summary.Design

2006-08-02 Thread Hamilton, Cody
Does anyone know how summary.Design in Hmisc selects the baseline level for an odds ratio? Does it select the level of the factor variable with the largest number of observations? Regards, -Cody This e-mail, facsimile, or letter and any files or attachmen...{{dropped}}

Re: [R] help with formatting legend in xyplot

2006-08-02 Thread Gabor Grothendieck
If you set it through par.settings then it will affect both the drawing and the legend: xyplot(Sepal.Length ~ Petal.Length, iris, groups = Species, auto.key = TRUE, par.settings = list(superpose.symbol = list(pch = "*", cex = 1))) On 8/2/06, Kaushik Katari <[EMAIL PROTECTED]> wrote: > I am doi

Re: [R] Syntax of Levene's test

2006-08-02 Thread Paul Smith
On 8/2/06, John Fox <[EMAIL PROTECTED]> wrote: > The argument y is the response variable and group is a factor defining > groups (as ?levene.test says). If you have more than one factor, then you > can use interaction() to create from them a factor with levels given by the > product set of the leve

[R] help with formatting legend in xyplot

2006-08-02 Thread Kaushik Katari
I am doing a xyplot: (x~y, groups = z, pch=8, auto.key=T). This changes the symbol in the graph to an asterisk (*), but not in the legend, which is still an open circle. I have found out how to manipulate the position and the color of the letters in the legend, but cannot change the legend symbol

Re: [R] Finding the position of a variable in a data.frame

2006-08-02 Thread John Kane
--- roger koenker <[EMAIL PROTECTED]> wrote: > it is the well-known wicked which problem: if you > had (grammatically > incorrectly) > thought "... which I want to change" then you might > have been led > to type (in another window): > > ?which > > and you would have seen the light. M

Re: [R] Finding the position of a variable in a data.frame

2006-08-02 Thread John Kane
--- Chuck Cleland <[EMAIL PROTECTED]> wrote: > John Kane wrote: > > Simple problem but I don't see the answer. I'm > trying > > to clean up some data > > I have 120 columns in a data.frame. I have one > value > > in a column named "blaw" that I want to change. > How do > > I find the coordinates

[R] question about stdize() in PLS package

2006-08-02 Thread jz7
Dear all, I am using the PLS package for PLSR analysis. And I have a basic question about the standardize procedure, which I feel the PLS manual does not explain clearly. I am hoping that I could get some help from the list. >From the example in the "Standardization of Data Matrices" section, I c

Re: [R] Finding the position of a variable in a data.frame

2006-08-02 Thread Chuck Cleland
John Kane wrote: > Simple problem but I don't see the answer. I'm trying > to clean up some data > I have 120 columns in a data.frame. I have one value > in a column named "blaw" that I want to change. How do > I find the coordinates. I can find the row by doing a > subset on the data.frame but ho

Re: [R] Finding the position of a variable in a data.frame

2006-08-02 Thread roger koenker
it is the well-known wicked which problem: if you had (grammatically incorrectly) thought "... which I want to change" then you might have been led to type (in another window): ?which and you would have seen the light. Maybe that() should be an alias for which()? url:www.econ.uiu

Re: [R] Finding the position of a variable in a data.frame

2006-08-02 Thread John Kane
--- jim holtman <[EMAIL PROTECTED]> wrote: > ?which > > > which(Df >= 50, arr.ind=T) > row col > 5 5 4 I knew it was going to be blinding obvious! I even read ?which somehow misunderstood arr.ind. Thanks again. > > On 8/2/06, John Kane <[EMAIL PROTECTED]> wrote: > > > > Simple probl

Re: [R] Finding the position of a variable in a data.frame

2006-08-02 Thread jim holtman
?which > which(Df >= 50, arr.ind=T) row col 5 5 4 On 8/2/06, John Kane <[EMAIL PROTECTED]> wrote: > > Simple problem but I don't see the answer. I'm trying > to clean up some data > I have 120 columns in a data.frame. I have one value > in a column named "blaw" that I want to change. How

[R] Finding the position of a variable in a data.frame

2006-08-02 Thread John Kane
Simple problem but I don't see the answer. I'm trying to clean up some data I have 120 columns in a data.frame. I have one value in a column named "blaw" that I want to change. How do I find the coordinates. I can find the row by doing a subset on the data.frame but how do I find out here "blaw "

[R] Course***Dr Frank Harrell's Regression Modeling Strategies in R/Splus course *** September 2006 near you (San Francisco, Washington DC, Atlanta)

2006-08-02 Thread elvis
__ 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 and provide commented, minimal, self-contained, reproducible code.

[R] tcl/tk bind destroy event

2006-08-02 Thread Franco Mendolia
Hello! I want to create a messagebox whenever the user wants to destroy the window (e.g. or the 'x' in the right top corner) and ask if a modified file should be saved or not. If 'cancel' is chosen then nothing should happen and the windows still should be existing. This doesn't work. When I

Re: [R] Summary method needed?

2006-08-02 Thread Prof Brian Ripley
On Wed, 2 Aug 2006, Christian Hennig wrote: > Thank you Brian! > > > > I'm updating my fpc package at the moment and will add some new functions. > > > I learned that there should be print and summary methods for the key > > > functions. > > > > for 'classes', I think. > > Yes. > > > > But in s

Re: [R] Correlation adjusted Bonferroni? (was: Multiple tests on repeated measurements)

2006-08-02 Thread JRG
On 2 Aug 2006 at 13:48, R Heberto Ghezzo, Dr wrote: > HI, just my 2 cents. Bonferroni et al, assume independent tests, thus > p ~ p*k with k the number of tests, in repeated measures, each measure > is correlated with the previous, so k is not 2 but 2-q. I do not know > q but it should be a functi

[R] ggplot facet label font size

2006-08-02 Thread Walker, Sam
How do I change the font size in the facet labels along the edges of the plot? For example (from the ggplot help file): p<-ggplot(tips, sex ~ smoker, aesthetics=list(x=tip/total_bill)) gghistogram(p) In this plot, the facet labels are "smoker: No", "smoker: Yes", "sex: Female", "sex: Ma

[R] lme4 and lmeSplines

2006-08-02 Thread Kevin Wright
I'm trying to use the lmeSplines package together with lme4. Below is (1) an example of lmeSplines together with nlme (2) an attempt to use lmeSplines with lme4 (3) then a comparison of the random effects from the two different methods. (1) require(lmeSplines) data(smSplineEx1) dat <- smSplineEx

Re: [R] Summary method needed?

2006-08-02 Thread Christian Hennig
Thank you Brian! >> I'm updating my fpc package at the moment and will add some new functions. >> I learned that there should be print and summary methods for the key >> functions. > > for 'classes', I think. Yes. >> But in some cases the print method will make use of more or less all the >> out

Re: [R] Summary method needed?

2006-08-02 Thread Prof Brian Ripley
On Wed, 2 Aug 2006, Christian Hennig wrote: > Hi list, > > I'm updating my fpc package at the moment and will add some new functions. > I learned that there should be print and summary methods for the key > functions. for 'classes', I think. > The purpose of the summary methods seems to be to

Re: [R] Correlation adjusted Bonferroni? (was: Multiple tests on repeated measurements)

2006-08-02 Thread R Heberto Ghezzo, Dr
HI, just my 2 cents. Bonferroni et al, assume independent tests, thus p ~ p*k with k the number of tests, in repeated measures, each measure is correlated with the previous, so k is not 2 but 2-q. I do not know q but it should be a function of the correlation between measures, ie the Sigma in ge

Re: [R] listing of permutations

2006-08-02 Thread Berton Gunter
I seem to be on a roll of being dumb today. Sorry for posting my previous silly solution to Erin's permutation problem. Please **do** ignore it. -- Bert > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Berton Gunter > Sent: Wednesday, August 02,

Re: [R] listing of permutations

2006-08-02 Thread Berton Gunter
Erin: You got 2 (so far) pre-packaged functions .Here's an obscenely inefficient but short un-prepackaged way to do it: k<-4 z<- do.call('expand.grid',as.data.frame(matrix(rep(1:k,k),nc=k))) results<- z[apply(z,1,function(x)length(unique(x))==k),] It is too inefficient to make public, though. --

[R] question about correlation coefficeint and root mean square (with code used)

2006-08-02 Thread jz7
Dear all, I am using different multiple regression models (OLS and principal component regression (PCR)) to make prediction of my test set. And those models come from the same training set, except that the number of variables or descriptors (columns of X) used in OLS is less than those used in PCR

Re: [R] listing of permutations

2006-08-02 Thread davidr
not very-well hidden: permutations in (e1071) permn in (combinat) David L. Reiner Rho Trading Securities, LLC Chicago IL 60605 312-362-4963 -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Erin Hodgess Sent: Wednesday, August 02, 2006 11:57 AM To: r-hel

[R] listing of permutations

2006-08-02 Thread Erin Hodgess
Dear R People: Suppose I have the 4 numbers: 1,2,3,4. I would like to create a listing of the permutations of 4 items taken 4 at a time. Is there a built in function for that, please? Thanks in advance! R 2-3-1 for Windows or Linux Sincerely, Erin Hodgess Associate Professor Department of Compu

[R] Summary method needed?

2006-08-02 Thread Christian Hennig
Hi list, I'm updating my fpc package at the moment and will add some new functions. I learned that there should be print and summary methods for the key functions. The purpose of the summary methods seems to be to reduce the possibly incredibly complex information in the function's output and th

[R] [Off-Topic-but somewhat related] DIA/FDA Open Toolbox Initiative

2006-08-02 Thread Soukup, Mat
UseR's- As this is slightly off-topic I will limit the discussion to only the major points; for further information feel free to reply off-line. DIA and FDA are hosting a forum to discuss (as per the Goal of the announcement--see link below) "a vendor-neutral software product to support validated

Re: [R] best way to calculate per-parameter differences in across-subject means

2006-08-02 Thread Dieter Menne
René J.V. Bertin gmail.com> writes: > I have some data in a data.frame where for each of a number of > subjects, I have scores for all of a number of symptoms. > > Subjects are subdivided in a number of groups, which have unequal sizes. > > I'd like to plot between-group differences in the scor

Re: [R] rpad, leaps, regsubsets

2006-08-02 Thread Berton Gunter
Boris: Thankyou for this. All the RPAD links now appear to be dead. However, the Reference Card is still available in the CONTRIBUTED link on CRAN, as I said. -- Bert Gunter Genentech Non-Clinical Statistics South San Francisco, CA > > Thanks for the resources, Berton. but unfortunately, that

[R] question about correlation coefficeint and root mean square

2006-08-02 Thread jz7
Dear all, I am using different multiple regression models (OLS and principal component regression (PCR)) to make prediction of my test set. And those models come from the same training set, except that the number of variables or descriptors (columns of X) used in OLS is less than those used in PCR

Re: [R] ordering columns (longitudinal data in wide format)

2006-08-02 Thread Gabor Grothendieck
Assuming this data: s <- structure(list(L.qol.0 = 83, L.qol.0.08 = 86, L.qol.0.17 = 89, L.qol.0.25 = 92, L.qol.0.5 = 91, L.qol.0.42 = 87, L.qol.0.34 = 90), .Names = c("L.qol.0", "L.qol.0.08", "L.qol.0.17", "L.qol.0.25", "L.qol.0.5", "L.qol.0.42", "L.qol.0.34"), class = "data.frame", r

Re: [R] read.spss and umlaut

2006-08-02 Thread Thomas Lumley
On Wed, 2 Aug 2006, Thomas Kuster wrote: Hello When I read a SPSS *.por file with read.spss everything after a umlaut is missing: This sounds like a conflict between encodings -- eg if R is assuming UTF-8 and the file is encoding in Latin-1 then the sequence U+00FC : LATIN SMALL LETTER U WI

[R] expected survival from a frailty cox model using survfit

2006-08-02 Thread Emmanuel Tillard
Hello R users Would somebody know how to estimate survival from a frailty cox model, using the function survfit and the argument newdata ? (or from any other way that could provide individual expected survival with standard error); Is the problem related to how the random term is included in ne

[R] ordering columns (longitudinal data in wide format)

2006-08-02 Thread z . dalton
Hi, I am working on some longitudinal data in wide format and I am having a problem ordering the data columns. To expand, a subset of what I am working on is as follows; >s L.qol.0 L.qol.0.08 L.qol.0.17 L.qol.0.25 L.qol.0.5 L.qol.0.42 L.qol.0.34 1 83 86 89 92

[R] best way to calculate per-parameter differences in across-subject means

2006-08-02 Thread René J.V. Bertin
Hello, I have some data in a data.frame where for each of a number of subjects, I have scores for all of a number of symptoms. Subjects are subdivided in a number of groups, which have unequal sizes. I'd like to plot between-group differences in the scores on the various symptoms. Ideally, that

Re: [R] Pseudo R for Quant Reg

2006-08-02 Thread roger koenker
This is getting to be a faq -- here is a prior answer: > No, but the objective function can be computed for any fitted > rq object, say f, as > > rho <- function(u,tau=.5)u*(tau - (u < 0)) > V <- sum(rho(f$resid, f$tau)) > > so it is easy to roll your own I don't much like R1, or

[R] Plotting a ranef object in NLME

2006-08-02 Thread Greg Distiller
Hi I am following the model building strategy that is outlined in the Pinheiro and Bates book wrt including covariates but am having a problem with the plot. Basically I am using 4 covariates (1 of them is continuous) and 3 of them are fine but the 4th one is being shown as a scatterplot despite

Re: [R] How to share variables

2006-08-02 Thread Gabor Grothendieck
On 8/2/06, Sergio Martino <[EMAIL PROTECTED]> wrote: > Hi, > > I would like to realize in R a structure like the fortran common ie a way to > declare some variable that can only be accessed by all the functions which > need to. > > Browsing the archive it seems that the simplest way is to declare t

[R] Pseudo R for Quant Reg

2006-08-02 Thread ricardosilva
Dear R Users, Did someone implemented the R1 (Pseudo R-2) and likelihood ratio statistics for quantile regressions, which are some of the inference procedures for quantile regression found in Koenker and Machado (1999)? I tried the Ox version, but my dataset is too large (> 50.000) and the al

[R] read.spss and umlaut

2006-08-02 Thread Thomas Kuster
Hello When I read a SPSS *.por file with read.spss everything after a umlaut is missing: > library("foreign") > spssdaten <- read.spss("projets.por") > attr(spssdaten$PROJETX, "value.labels")[1:20] Bg Stammzellenforschung Bb

[R] read.spss and umlaut

2006-08-02 Thread Thomas Kuster
Hello When I read a SPSS *.por file with read.spss everything after a umlaut is missing: > library("foreign") > spssdaten <- read.spss("projets.por") > attr(spssdaten$PROJETX, "value.labels")[1:20] Bg Stammzellenforschung Bb

Re: [R] Fitting models in a loop

2006-08-02 Thread Murray Jorgensen
Thanks to all for their help. I am busy today but tomorrow I will have time to digest all the feedback and follow up if necessary Cheers, Murray -- Dr Murray Jorgensen http://www.stats.waikato.ac.nz/Staff/maj.html Department of Statistics, University of Waikato, Hamilton, New Zealand Emai

Re: [R] missing value

2006-08-02 Thread Jacques VESLOT
dat[dat==9] <- NA because the result of mean() is real and summary()'s output is a vector. --- Jacques VESLOT CNRS UMR 8090 I.B.L (2ème étage) 1 rue du Professeur Calmette B.P. 245 59019 Lille Cedex Tel : 33 (0)3.20.87.10.44 Fax : 33

[R] How to share variables

2006-08-02 Thread Sergio Martino
Hi, I would like to realize in R a structure like the fortran common ie a way to declare some variable that can only be accessed by all the functions which need to. Browsing the archive it seems that the simplest way is to declare the variables and the functions in a big function which wraps all.

Re: [R] missing value

2006-08-02 Thread Uwe Ligges
Mauricio Cardeal wrote: > Hi all > > # I have this data set and how can I assign NA´s in just one command ? is.na(dat[dat==9]) <- TRUE > And why the summary(dat) function preserves the value 9 as real. ? > Because you have not changed the contents of dat at all, only the contents of x,y,z, an

[R] missing value

2006-08-02 Thread Mauricio Cardeal
Hi all # I have this data set and how can I assign NA´s in just one command ? And why the summary(dat) function preserves the value 9 as real. ? x <- c(1,2,3,9,4) y <- c(3,6,9,2,3) z <- c(9,9,2,2,8) w <- c(6,5,3,0,9) dat <- cbind(x,y,z,w) summary(dat) x[x==9] <- NA y[y==9] <- NA z[z==9] <- NA

Re: [R] Syntax of Levene's test

2006-08-02 Thread John Fox
Dear Paul, The argument y is the response variable and group is a factor defining groups (as ?levene.test says). If you have more than one factor, then you can use interaction() to create from them a factor with levels given by the product set of the levels of the individual factors. Here's an exa

Re: [R] loop, pipe connection, quote/unquote

2006-08-02 Thread Gabor Grothendieck
Try something along these lines assuming that the current directory is \Program Files\R\R-2.3.1pat. Note use of paste to create the command line to pass to pipe: # search for indicated string in each of the files and # for each match output the file name Files <- c("CHANGES", "COPYING", "NEWS", "

[R] Trying to use segmented in a function

2006-08-02 Thread Rob Knell
Hi folks I wonder if anyone can help me. I want to run some simulations to see how big a sample size might be necessary to distinguish a curved bivariate relationship (e.g. something that might be best described by a quadratic model) from a relationship that is two straight lines with a su

[R] loop, pipe connection, quote/unquote

2006-08-02 Thread Marco Grazzi
Hi all, I have the following problem. Inside R, I am trying to run a loop on several files. The data are stored in these files in a peculiar way, thus, at the same time I load the data, I would like to invoke a utility. I do this with "pipe". (The utility I am using is gbget from the package gb

[R] Syntax of Levene's test

2006-08-02 Thread Paul Smith
Dear All I am trying to use Levene's test (of package car), but I do not understand quite well how to use it. '?levene.test' does not unfortunately provide any example. My data are in a data frame and correspond to 4 factors plus response. Could someone please give me an example about how to use t

Re: [R] HELP with NLME

2006-08-02 Thread Spencer Graves
Have you tried fitting the model with "verbose=TRUE" and possibly also "control=nlmeControl(msVerbose=TRUE)"? Also, have you consulted Pinheiro and Bates (2000) Mixed-Effects Models in S and S-PLUS (Springer)? That book contains several examples of use of lme and nlme. R s

Re: [R] Support vector in lcrabs example

2006-08-02 Thread Prof Brian Ripley
The examples in the book were run in 2001, using S-PLUS (as it says). The R package e1071 has changed since then, and hence the results it gives have changed. However, the S-PLUS version (which has not been updated) still gives the results in the book. The `problem' is your expectation that R

[R] Support vector in lcrabs example

2006-08-02 Thread G.C. McGuinness
Can anyone explain the root of my problem? When I type the following code into R, I receive 42 support vectors insted of the 21 stated in the book 'Modern Applied Statistics with S': library(MASS); library(e1071); library(class); lcrabs <- log(crabs[,4:8]); (svm(crabs$sp ~ ., data = lcrabs, cost

Re: [R] Correlation adjusted Bonferroni? (was: Multiple tests on repeated measurements)

2006-08-02 Thread Spencer Graves
I'm not familiar with the correlation adjustment to Bonferroni you mention below, though it sounds interesting. However, I think there is something not right about it or about how you have interpreted it. Your code produced the following for me: p.value.raw p.value.bon p.va

Re: [R] questions on aggregate data

2006-08-02 Thread Jacques VESLOT
data.frame(x = with(df1, rep(x, freq))) --- Jacques VESLOT CNRS UMR 8090 I.B.L (2ème étage) 1 rue du Professeur Calmette B.P. 245 59019 Lille Cedex Tel : 33 (0)3.20.87.10.44 Fax : 33 (0)3.20.87.10.31 http://www-good.ibl.fr -

[R] rpad, leaps, regsubsets

2006-08-02 Thread Boris Garbuzov
Thanks for the resources, Berton. but unfortunately, that rpad link fails, and I still do not know where to get leaps or regsubsets functions. Sincerely, Boris. -- Hello, dear r team. Please help the newbie. My r is not finding leaps or regsubsets finctions. What should I do? Any na

[R] questions on aggregate data

2006-08-02 Thread zhijie zhang
Dear friends, my question is how to aggregate dataset and the inverse manipulation. e.g.My dataset data structure1: x 1 1 2 3 3 data structure2: x freq 1 2 2 1 3 2 Then how to generate dataset2 from dataset1 and generate dataset1 from dataset2? e.g. dataset2 from dataset1 : x<-c(1,1,2,3,3)