[R] Combining two ANOVA outputs of different lengths

2007-08-10 Thread Christoph Scherber
in advance! Best wishes Christoph -- Dr. Christoph Scherber DNPW, Agroecology University of Goettingen Waldweg 26 D-37073 Goettingen Germany phone +49(0)551 39 8807 fax +49(0)551 39 8806 __ R-help

[R] Selecting all values smaller than X in a dataframe

2007-06-11 Thread Christoph Scherber
(w,abs(w),,0.6)] The problem is that using sapply with or doesn´t seem to work. How could I solve this problem? Thank you very much in advance for your help! Best wishes Christoph (I am using R 2.5.0 on Windows XP). -- Christoph Scherber DNPW, Agroecology University of Goettingen Waldweg 26

Re: [R] reading a big file

2007-05-24 Thread Christoph Scherber
Dear Remigijus, You should change memory allocation in Windows XP, as described in http://cran.r-project.org/bin/windows/base/rw-FAQ.html#There-seems-to-be-a-limit-on-the-memory-it-uses_0021 Hope this helps. Best wishes Christoph -- Christoph Scherber DNPW, Agroecology University

[R] Chosing a subset of a non-sorted vector

2007-05-21 Thread Christoph Scherber
wishes, Christoph (I am using R 2.4.1 on Windows XP) ## Christoph Scherber DNPW, Agroecology University of Goettingen Waldweg 26 D-37073 Goettingen +49-(0)551-39-8807 __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help

[R] lme4/lmer: P-Values from mcmc samples or chi2-tests?

2007-02-13 Thread Christoph Scherber
Dear R users, I have now tried out several options of obtaining p-values for (quasi)poisson lmer models, including Markov-chain Monte Carlo sampling and single-term deletions with subsequent chi-square tests (although I am aware that the latter may be problematic). However, I encountered

[R] lmer and estimation of p-values: error with mcmcpvalue()

2007-02-12 Thread Christoph Scherber
Dear all, I am currently analyzing count data from a hierarchical design, and I?ve tried to follow the suggestions for a correct estimation of p-values as discusssed at R-Wiki (http://wiki.r-project.org/rwiki/doku.php?id=guides:lmer-testss=lme%20and%20aov). However, I have the problem that my

Re: [R] lmer and estimation of p-values: error with mcmcpvalue()

2007-02-12 Thread Christoph Scherber
Christoph ## Dr. rer. nat. Christoph Scherber DNPW, Agroecology University of Goettingen Waldweg 26 D-37073 Goettingen http://wwwuser.gwdg.de/~uaoe/Agroecology.html +49-(0)551-39-8807 Henric Nilsson (Public) schrieb: Den Må, 2007-02-12, 13:58 skrev Christoph Scherber: Dear all, I am

[R] Poisson example from Snedechor Cochran

2006-11-15 Thread Christoph Scherber
Dear R users, I am trying to reproduce table 7.4.12 (page 131) from Snedechor Cochran (eigth edition); the example is counts of weed seeds with a fitted Poisson distribution, tested for goodness-of-fit using a Chi-square: observed=c(3,17,26,16,18,9,3,5,0,1,0,0)

[R] Poisson example from Snedechor Cochran

2006-11-15 Thread Christoph Scherber
Dear R users, I am trying to reproduce table 7.4.12 (page 131) from Snedechor Cochran (eigth edition); the example is counts of weed seeds with a fitted Poisson distribution, tested for goodness-of-fit using a Chi-square: observed=c(3,17,26,16,18,9,3,5,0,1,0,0)

[R] Batch printing of existing postscript files with file names included

2006-05-10 Thread Christoph Scherber
Dear R users, I have created a series of postscript files and I´d like to print them with the file name added to the printout. Is there a way of reading these files into R (e.g. using rimage after conversion to jpeg), adding the file name, and then sending the files to a windows printer? I

[R] Use of step() with an unbalanced ANOVA model

2006-03-10 Thread Christoph Scherber
Dear all, Is it dangerous to use step() during model simplification when I have an ANOVA design that is unbalanced (i.e. there is order dependence when entering the terms into the full model)? Thanks very much for your help! Kind regards, Christoph

[R] xyplot question

2005-12-06 Thread Christoph Scherber
Dear R users, I have a question regarding the use of xyplot in the lattice() package. I have two factors (each with two levels), and I´d like to change the order of the panels in a 2x2 panel layout from the default alphabetic order that R uses based on the names of the factor levels. My

[R] Calculation of the median in survfit()

2005-11-18 Thread Christoph Scherber
Dear R users, Can anyone tell me how the medians in survfit() are computed? I´ve looked it up in the source code (print.survfit.s version 4.19 07/09/00), but I´m not a programmer...;-) Especially, I´d like to know what the pfun() function inside print.survfit.s() works. The help file does

[R] Mean survival times

2005-11-17 Thread Christoph Scherber
Dear list, I have data on insect survival in different cages; these have the following structure: deathtime status id cageS F G L S 1.5 1 1 C1 8 2 1 1 1 1.5 1 2 C1 8 2 1 1 1 11.5 1 3 C1 8

[R] trellis: positioning of key

2005-11-09 Thread Christoph Scherber
Dear R users, Using xyplot(), how can I position the key in the *margin* outside the plotting area ? My problem is that the key always overlaps with the x axis labels, no matter how I try to specify any of the par() arguments (e.g. oma()). Many thanks for any suggestions! Christoph ### for

[R] standard errors in summary.lm

2005-11-01 Thread Christoph Scherber
Dear R users, If I have an aov object, how are the standard errors of the estimates in summary.lm calculated? Using treatment contrasts, I would like to use the estimated differences in mean values (intercepts) to calculate the mean values per factor level, and for these mean values I´f like

[R] aggregating using several functions

2005-10-24 Thread Christoph Scherber
Dear R users, I would like to aggregate a data frame using several functions at once (e.g., mean plus standard error). How can I make this work using aggregate()? The help file says scalar functions are needed; can anyone help? Below is the code for my meanse function which I´d like to use

[R] dataframe (matrix) multiplication

2005-10-14 Thread Christoph Scherber
Dear R users, Suppose I have 2 parts of a dataframe, say ABCD 2143 3245 2154 (the real dataframe is 160 columns with each 120 rows) and I want to multiply every element in [,A:B] with every element in [,C:D]; What is the most elegant way to do this? I´ve been thinking of converting [,A:B] to

[R] lme and ordering of terms

2005-08-29 Thread Christoph Scherber
Dear R users, When fitting a lme() object (from the nlme library), is it possible to test interactions *before* main effects? As I understand, R conventionally re-orders all terms such that highest-order interactions come last - but I´d like to know if it´s possible (and sensible) to change

[R] regression with more than one observation per x value

2005-08-16 Thread Christoph Scherber
Dear R users, How can I do a regression analysis in R where there is more than one observation per x value? I tried the example in SokalRohlf (3rd edn., 1995), page 476 ff., but I somehow couldn´t find a way to partition the sums of squares into linear regression, deviations from regression,

[R] JGR and R 2.0.X

2005-05-04 Thread Christoph Scherber
Dear all, I am running Windows XP with several parallel installations of R (2.0.1; 2.1 and so on). How can I install JGR for the 2.0.1 version? I keep on getting error messages when trying to install it. Best wishes Christoph __

[R] apply question

2005-05-02 Thread Christoph Scherber
Dear R users, I´ve got a simple question but somehow I can´t find the solution: I have a data frame with columns 1-5 containing one set of integer values, and columns 6-10 containing another set of integer values. Columns 6-10 contain NA´s at some places. I now want to calculate (1) the number

[R] glm with poisson errors

2005-04-01 Thread Christoph Scherber
Dear R users, I have data on percentage leaf area damaged (in classes, e.g. 1%, 5%, 10%) in plants. My two questions are: (1) Could I use a glm with poisson errors on these data? (2) Could I still use this glm with poisson errors after arcsine transformation of the data? Thank you very much

Re: [R] some help interpreting ANOVA results, please?

2005-02-16 Thread Christoph Scherber
Dear RenE, Can you explain a bit more how you derive your T.SPart? That´s what I think is the tricky part of your analysis. I would suggest you should try to end up with something like this: model1-aov(SR~WasSick*Time+Error(Subject/Time) model2-aov(SR~SC*Time+Error(Subject/Time) This way it

[R] xyplot() question

2005-02-10 Thread Christoph Scherber
Dear R Users, I have an xyplot() where different plotting symbols are used for subgroups (originally used within S-Plus, but hopefully it´s also applicable to R users). How can I fit separate regression lines for every subgroup? So far, I can only plot the overall fitted line. The code looks

[R] panel plot with log-scaled x-axis

2005-02-08 Thread Christoph Scherber
Dear all, Can anyone help me plotting a panel plot with log-scaled x axes? My formula looks like this: coplot(response~div|treatment+grass, panel=function(x,y,...){panel.xyplot(x,y,...);panel.lmline(x,y,...)}) And I´d like to have div plotted in log scale. Thanks very much for your help! Best

Re: [R] publishing random effects from lme

2005-02-04 Thread Christoph Scherber
Hi Dieter, Yes, I´ve tried both options. The anova(lme(...)) gives me good results for the fixed effects part, but what I´m specifically interested in is what to do with the random effects. I have tried glmmPQL (generalized linear mixed-effects models), which did in fact greatly help account

[R] integration function

2005-02-04 Thread Christoph Scherber
Dear R users, I have tried to write a function which gives the step-wise integral for an exponential function (moving from -3 to 3 in steps of 0.1, where the output for every step shall be the integral under the curve of y against x. However, something seems to be wrong with this function; can

Re: [R] Split-split plot ANOVA

2005-02-03 Thread Christoph Scherber
Hi Mike, Do you have a schematic drawing of how exactly your treatments were applied? In split-plot experiments, it is generally very important to clearly define the sequence of plot sizes, because if you don´t do this properly, then the output will be confusing. Checking if your degrees of

[R] publishing random effects from lme

2005-02-02 Thread Christoph Scherber
Dear all, Suppose I have a linear mixed-effects model (from the package nlme) with nested random effects (see below); how would I present the results from the random effects part in a publication? Specifically, I´d like to know: (1) What is the total variance of the random effects at each

[R] random effects in lme

2005-02-02 Thread Christoph Scherber
Dear all, Suppose I have a linear mixed-effects model (from the package nlme) with nested random effects (see below); how would I present the results from the random effects part in a publication? Specifically, I´d like to know: (1) What is the total variance of the random effects at each

Re: [R] self-written function

2005-01-28 Thread Christoph Scherber
Hi! I´m using the function for a data frame, but up to now it only works with single vectors, such as backsin(variable,grouping.factor) Actually, you´re right, the ... in the function definition is not needed...:-) Regards Christoph Erin Hodgess wrote: Hello Christoph! I have a question about

Re: [R] self-written function

2005-01-28 Thread Christoph Scherber
was the response and how it differ from expected output and best of all ***working*** example? BTW, what is stdev? If you wanted to compute standard deviation sd is enough. Cheers Petr On 27 Jan 2005 at 12:20, Christoph Scherber wrote: Dear all, Ive got a simple self-written function

Re: [R] self-written function

2005-01-28 Thread Christoph Scherber
No idea if this helps, but it was a problem with the code anyway. cheers, jari oksanen On Fri, 2005-01-28 at 11:04 +0100, Christoph Scherber wrote: Hi! OK, here are some more details on the function: My dataframe consists of several columns of categorical variables (let´s call them A,B,C) plus

[R] self-written function

2005-01-27 Thread Christoph Scherber
Dear all, I´ve got a simple self-written function to calculate the mean + s.e. from arcsine-transformed data: backsin-function(x,y,...){ backtransf-list() backtransf$back-((sin(x[x!=NA]))^2)*100 backtransf$mback-tapply(backtransf$back,y[x!=NA],mean)

Re: [R] lme and varFunc()

2005-01-26 Thread Christoph Scherber
Dear all, I am expecting a Poisson error distribution in my lme with weights=varFunc(). The weigths= varPower (form= fitted (.)) doesn´t work due to missing values in the response: Problem in lme.formula(fixed = sqrt(nrmainaxes + 0...: Maximum number of iterations reached without convergence.

Re: [R] lme and varFunc()

2005-01-25 Thread Christoph Scherber
the variance model. If you use the argument type=p then you get the Pearson residuals, which will reflect the weights model. Try something like this: plot(model, resid(., type = p) ~ fitted(.), abline = 0) I hope that this helps, Andrew On Mon, Jan 24, 2005 at 02:28:44PM +0100, Christoph Scherber

[R] Box-Cox / data transformation question

2005-01-25 Thread Christoph Scherber
Dear R users, Is it reasonable to transform data (measurements of plant height) to the power of 1/4? I´ve used boxcox(response~A*B) and lambda was close to 0.25. Regards, Christoph __ R-help@stat.math.ethz.ch mailing list

[R] comparing glmmPQL models

2005-01-24 Thread Christoph Scherber
Dear R users, Is there a way to compare glmmPQL models differing in their fixed-effects structure (similar to the ANOVA approach in lme) ? Thank you very much for your help! Chris. This mail was sent through

[R] lme and varFunc()

2005-01-24 Thread Christoph Scherber
Dear R users, I am currently analyzing a dataset using lme(). The model I use has the following structure: model-lme(response~Covariate+TreatmentA+TreatmentB,random=~1|Block/Plot,method=ML) When I plot the residuals against the fitted values, I see a clear positive trend (meaning that the

[R] mixed effects model:how to include initial conditions

2005-01-21 Thread Christoph Scherber
Dear R users, I am analyzing a dataset on growth of plants in response to several factors. I am using a mixed-effects model of the following structure: model-lme(growth~block*treatment*factor1*factor2, random=~1|plot/treatment/initialsize) I have measured the initial size of the plants (in 2003)

Re: [R] Naming Convention

2005-01-13 Thread Christoph Scherber
Dear Reinhold, All entries are allowed except price swap or price_swap Of course it´s most convenient to use short names and small letters for quicker typing. Regards Christoph Quoting Hafner, Reinhold (Risklab) [EMAIL PROTECTED]: I was wondering whether there exists a naming convention

Re: [R] Calculate Mean of Column Vectors?

2005-01-11 Thread Christoph Scherber
Dear Thomas, My suggestion would be as follows: y - rnorm(3000) dim(y) - c(3, 1000). #then create three column vectors out of y using cbind(): w-cbind(y[1,],y[2,],y[3,]) # and calculate the row means for (i in 1:1000) z[i]-mean(w[i,1:3]) z Hope I got it right! Regards, Christoph Thomas Hopper

[R] coercing columns

2005-01-07 Thread Christoph Scherber
Dear all, I have a data frame that looks like this: c1 c2 c3 ABC BCA AAB and so on; I´d like to produce one single vector consisting of the columns c1,c2, c3, such that vector=(A,B,A,B,C,A,C,A,B) I guess it´s easy to do but I don´t know how...Can anyone help me?

[R] treatment contrasts and summary.lm

2004-12-02 Thread Christoph Scherber
Dear list members, I have a 2-factor ANOVA where the summary.lm output looks like this (using treatment contrasts): Value Std. Error t value Pr(|t|) (Intercept) 0.0389 0.0220 1.7695 0.0817 as.factor(Block)1 0.0156 0.0066 2.3597 0.0215 as.factor(Block)2

Re: [R] Dominant factors in aov?

2004-12-02 Thread Christoph Scherber
Dear Rene, First of all, note that A,B,C,D, and E need to be declared as factors in the beginning, using factor() (but I think you did this already). Also, make sure that the data are read into R in the correct way (i.e. . separating decimal places). The reason for the singularities is that B,

Re: [R] Dominant factors in aov?

2004-12-02 Thread Christoph Scherber
Dear Rene, At least from the part of the data.frame attached to your mail, I assumed that C,D and E changed in identical ways (but maybe I got this wrong). With your following combination of factors: A (four levels) B (three levels) C (two levels) D (29 levels) with E (four replicates) And

[R] integration problem

2004-10-26 Thread Christoph Scherber
Dear R users, I have spectral data (say, wavelength vs. extinction coefficient) for which I´d like to calculate an integral (i.e. the area underneath the curve). Suppose the (artificial) dataset is lambda E 1 2 2 4 3 5 4 8 5 1 6 5 7 4 8 9 9

[R] error bars

2004-08-21 Thread Christoph Scherber
Dear all, is there an easy way to create error bars for the following types of plots: a) barplots b) interaction plots Many other statistics packages (e.g. Statistica) offer very nice interaction plots with error bars, and I´d like to be able to do the same in R. Best regards Christoph

[R] analysis of life tables

2004-08-15 Thread Christoph Scherber
Dear all, How can I analyze a life table (e.g. for a cohort of insects) in R? I have 20 insects in 200 cages with two different treatments, whose survival is followed over time, such that, e.g., in one treatment, the number of animals surviving is c(20,18,16,12,10,8,4,0), while in the other

[R] log-linear contrasts

2004-08-09 Thread Christoph Scherber
Dear list members, suppose I have a one-way ANOVA where the explanatory variable is of class ordered(). How can I define, instead of the default linear, quadratic, cubic contrasts, a set of log-linear contrasts corresponding to logb(c(1,2,4,8,16,60)+1,2) ? Regards, Christoph

Re: [R] reading data

2004-05-05 Thread Christoph Scherber
Just one small remark: why don´t you try (C:\\dados10.txt) ? It seems to me that the double \\ is important! Cheers Chris Christoph Lange wrote: (Reply to Margarida Júlia Rodrigues Igreja) Hello! When i print: a-read.table(file=C:/dados10.txt) The next error appears: Error in

[R] lm(y~x) question: removing NA´s

2004-05-04 Thread Christoph Scherber
Dear all, I have a data frame with different numbers of NA´s in each column, e.g.: x y 1 2 NA 3 NA 4 4 NA 1 5 NA NA I now want to do a linear regression on y~x with all the NA´s removed. The problem now is that is.na(x) (and is.na(y) obviously gives vectors with different

[R] more on lm(y~x) question: removing NA´s

2004-05-04 Thread Christoph Scherber
, because options(na.action) is `na.omit'. If you really want to do it `by hand', and have the data in a data frame, you can use something like: lm(y ~ x, df[complete.cases(df),]) HTH, Andy From: Christoph Scherber Dear all, I have a data frame with different numbers of NA´s in each column, e.g

Re: [R] RE: more on lm(y~x) question: removing NA´s

2004-05-04 Thread Christoph Scherber
to use for lm. -thomas Andy From: Christoph Scherber actually, the situation is much more complicated. I am producing multiple graphs within a for loop. For some strange reason, the plotting routine always stops once lm(y~x) encounters more than one missing value (I have marked

Re: [R] RE: more on lm(y~x) question: removing NA´s

2004-05-04 Thread Christoph Scherber
Great!!! This works, many thanks! ** using lsfit(x,y) instead of lm(y~x) produces a perfectly correct output. *** Thomas Lumley wrote: On Tue, 4 May 2004, Christoph Scherber wrote: it all works fine (the regression lines fit correctly to the data) as long

[R] quantile regression

2004-03-12 Thread Christoph Scherber
Dear colleagues, How can I do quantile regression with R? Best regards Chris. __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Re: [R] quantile regression

2004-03-12 Thread Christoph Scherber
OK, Thank you all very much for the help! Best regards Chris. Christoph Scherber wrote: Dear colleagues, How can I do quantile regression with R? Best regards Chris. __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r

[R] binomial errors in split-plot design

2004-03-04 Thread Christoph Scherber
Dear all, I have proportion data with binomial errors. The problem is that the whole experiment was laid out as a split-plot design. Ideally, what I would like is having a glm with an Error term such as glm(y~x+Error(A/B)) but I fear this is not possible. Would using lme be an alternative?

Re: [R] binomial errors in split-plot design

2004-03-04 Thread Christoph Scherber
). Be careful with the interpretation, as you don't have the advantages of balance that the classical AoV gives you. On Thu, 4 Mar 2004, Christoph Scherber wrote: I have proportion data with binomial errors. The problem is that the whole experiment was laid out as a split-plot design. Ideally

Re: [R] interactive graphic s

2004-03-03 Thread Christoph Scherber
Dear Ruben, Yes, the iplots package works fine! You can download it from http://stats.math.uni-augsburg.de/iPlots/index.shtml Good luck! Chris. [EMAIL PROTECTED] wrote: Hi, i dont understand ¿Graphics in R are interactives or not?, I hear the the package iplots can do it (zoom, scaling etc),

Re: [R] zoom graphics

2004-03-03 Thread Christoph Scherber
Interactive Plots with zoom options etc. can be performed using the iplots library. It´s really very useful and can be downloaded from http://stats.math.uni-augsburg.de/iPlots/index.shtml Best regards Chris Barry Rowlingson wrote: [EMAIL PROTECTED] wrote: Hi, i don't understand how i cant

Re: [R] boxplot notches

2004-03-02 Thread Christoph Scherber
this be possible? Regards, Christoph. David James wrote: Prof Brian Ripley wrote: On Mon, 1 Mar 2004, Martin Maechler wrote: TL == Thomas Lumley [EMAIL PROTECTED] on Mon, 1 Mar 2004 09:54:48 -0800 (PST) writes: TL On Mon, 1 Mar 2004, Christoph Scherber wrote: Dear list members, Can anyone

Re: [R] boxplot notches

2004-03-02 Thread Christoph Scherber
In McGill et al. (1978) there´s a description of the calculation as follows (p. 16): The widths [are] computed from the midspread or interquartile range (R) of the data (...), and the number of observations (N) for each group. The Gaussian-based asymptotic approximation (Kendall and Stuart

[R] boxplot notches

2004-03-01 Thread Christoph Scherber
Dear list members, Can anyone tell me how the notches in boxplot(Y~X,notch=T) are calculated? What do these notches represent exactly? I´d suppose they are Conficence Intervals for the median, but I´ve also been told they might show Least Significant Difference (LSD) equivalents. I would