[R] Heterogeneous variance in two-way mixed ANOVA

2010-07-21 Thread Kline, Keith A
I have heterogeneous variance in a two-way mixed effects ANOVA, with more than 2 groups in each factor. Is there something like oneway.test or a Brown-Forsythe test that will let me test for differences in means? Thanks! -Keith __ R-help@r-project.o

[R] R forum

2010-07-21 Thread saminny
Hi, Are there any other forums on R where I can get quick responses to my questions? I've lot of questions as I am learning the basics and exploring advanced computational functions and it is tough to wait for moderator approval then a reply to each of those questions. thanks! Samit -- View thi

[R] newton method

2010-07-21 Thread saminny
Is there a non animation version of newton.method (http://bm2.genes.nig.ac.jp/RGM2/R_current/library/animation/man/newton.method.html) for finding roots of a function? It should find the roots without showing it on the GUI. thanks, Sam -- View this message in context: http://r.789695.n4.nabble

[R] R find limit of a function

2010-07-21 Thread saminny
Hello, HOw do I find limit of a function in R? thanks, Samit -- View this message in context: http://r.789695.n4.nabble.com/R-find-limit-of-a-function-tp2298097p2298097.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-proje

Re: [R] .jinit and .jnew

2010-07-21 Thread behrooz
behrooz wrote: > > i have a jar under z:/downloads/AA, i use > .jinit(classpath="z:/downloads/AA") and then > .jnew("Myclass") but .jnew throes an error: > > Error in .jnew("MyClass") : > java.lang.NoClassDefFoundError: MyClass > > tried > > .jinit(classpath="z:/downloads/AA/myClass.jar")

Re: [R] "lmomRFA" package: error bounds/confidence intervals

2010-07-21 Thread J. R. M. Hosking
On 2010-07-21 09:37, Tonja Krueger wrote: Dear List I’m using the ”lmomRFA” package to fit different distributions to my data sample. To calculate the error bounds I used: regsimq(…) and sitequantbounds(…) So my questions are: Are error bounds and confidence intervals the same thin

Re: [R] legend in R plot

2010-07-21 Thread Dennis Murphy
Hi: It would really help to have a reproducible example to see exactly what problems you're having, but here's a simple manufactured example to illustrate how to produce a basic legend. The plot below is one with three different 'y' variables against the same x. The x and y limits are made wide en

[R] Random slope with npmlreg

2010-07-21 Thread Shige Song
Dear All, I am trying to estimate a mixed effect model with random slope with npmlreg. To make my question clear, I use the sample data set that was used in the vignettes (as part of the package "nlme"). -

[R] legend in R plot

2010-07-21 Thread li li
Hi all, I am have some difficulty with the legend function. I need to add a legend to describe the different line types in a plot. The legend box is small. It did not include sufficient length of each line type to help distinguish the differnt line types. Is there a way to fix this. Thank y

Re: [R] Issues reshaping data

2010-07-21 Thread JGull8502
I received two replies earlier today and have solved the issue. Tomorrow, I can post a sample data set, the other replies, and the solution for posterity. -- View this message in context: http://r.789695.n4.nabble.com/Issues-reshaping-data-tp2297853p2298099.html Sent from the R help mailing lis

Re: [R] String processing - is there a better way

2010-07-21 Thread Martin Morgan
On 07/21/2010 10:02 AM, Davis, Brian wrote: > I have a two part question > > Part 1) I am trying to remove characters in a string based on the > position of a key character in another string. I have a solution that works but it requires a for-loop. A vectorized way of doing this has alluded me. H

Re: [R] xtable

2010-07-21 Thread David Winsemius
Or class(influencia) and then see it is in this vector: > methods(xtable) [1] xtable.anova* xtable.aov* xtable.aovlist* [4] xtable.coxph* xtable.data.frame* xtable.glm* [7] xtable.lm* xtable.matrix* xtable.prcomp* [10] xtable.summary.a

Re: [R] lm: order of dropped columns

2010-07-21 Thread Anirban Mukherjee
Hi all, Thanks Dennis, do greatly appreciate the detailed reply. That does answer a significant part of what I was getting at. Unfortunately, I did not ask my question very well. Apologize. Suppose I run > dat <- data.frame(a = factor(rep(letters[1:3], each = 4)), + b = factor(re

Re: [R] xtable

2010-07-21 Thread John Kane
Try str(influencia) I don't think xtable is intended to print lists. --- On Wed, 7/21/10, Silvano wrote: > From: Silvano > Subject: [R] xtable > To: r-help@r-project.org > Received: Wednesday, July 21, 2010, 4:15 PM > Hi, > > How do I build a table from a regression model adjusted > using xta

Re: [R] Issues reshaping data

2010-07-21 Thread John Kane
A small useable data set would help immensely. Have a look at ?dput as a way to supply one. --- On Wed, 7/21/10, JGull8502 wrote: > From: JGull8502 > Subject: [R] Issues reshaping data > To: r-help@r-project.org > Received: Wednesday, July 21, 2010, 6:05 PM > > Hello All, > > I'm having so

Re: [R] reverse direction with rollapply()

2010-07-21 Thread Joshua Wiley
That makes sense. Thanks Gabor! Josh On Wed, Jul 21, 2010 at 4:07 PM, Gabor Grothendieck wrote: > On Wed, Jul 21, 2010 at 6:59 PM, Joshua Wiley wrote: >> Hello, >> >> I am using rollapply() from package zoo to use a function on unique >> windows from a dataset.  Because my dataset is not a mul

Re: [R] reverse direction with rollapply()

2010-07-21 Thread Gabor Grothendieck
On Wed, Jul 21, 2010 at 6:59 PM, Joshua Wiley wrote: > Hello, > > I am using rollapply() from package zoo to use a function on unique > windows from a dataset.  Because my dataset is not a multiple of my > window width, it matters which end I start at.  Here is a simple > example, the result I wan

[R] reverse direction with rollapply()

2010-07-21 Thread Joshua Wiley
Hello, I am using rollapply() from package zoo to use a function on unique windows from a dataset. Because my dataset is not a multiple of my window width, it matters which end I start at. Here is a simple example, the result I want is 7.5 (i.e., start at the highest level of my ordering variabl

Re: [R] post hoc test for lme using glht ?

2010-07-21 Thread David Winsemius
On Jul 21, 2010, at 6:36 PM, SNAFU1 wrote: Hi, I have a fairly simple repeated measures-type data set I've been attempting to analyze using the lme function in the nlme package. Repeated searches here and other places lead me to believe I have specified my model correctly. However, I a

Re: [R] Variance of the prediction in the linear regression model (Theory and programming)

2010-07-21 Thread Yi
Thank you for response. For question 2, Since I need to know the expectation of Y for new observations, let's say X*. So I need to know the expectation and also the variance of log (Y|X*). I know 'fitted(lin)' will give me the E[log(Y|X*)]. But I do not know how to get var[log(Y|X*)] or say sd[

Re: [R] Command that is conditional upon file retrieval: is it possible?

2010-07-21 Thread David Winsemius
On Jul 21, 2010, at 5:33 PM, AndrewPage wrote: Hi all, I'm currently working on an R program where I have to access an FTP server to download some of the data I need. However, the people who post up the files I access are at times inconsistent with regards to time posted, if they post

Re: [R] Variance of the prediction in the linear regression model (Theory and programming)

2010-07-21 Thread Dennis Murphy
Hi: On Wed, Jul 21, 2010 at 2:29 PM, Yi wrote: > Hi, folks, > > Here are the codes: > > ## > y=1:10 > x=c(1:9,1) > lin=lm(log(y)~x) ### log(y) is following Normal distribution > x=5:14 > prediction=predict(lin,newdata=x) ##prediction=predict(lin) > ### > predict() need

[R] post hoc test for lme using glht ?

2010-07-21 Thread SNAFU1
Hi, I have a fairly simple repeated measures-type data set I've been attempting to analyze using the lme function in the nlme package. Repeated searches here and other places lead me to believe I have specified my model correctly. However, I am having trouble with post-hoc tests. From what I

Re: [R] Help with time in R

2010-07-21 Thread Saeed Abu Nimeh
You can use strptime to specify the format of the date and time you want, e.g. > x1<-strptime(x, "%Y-%m-%d %H:%M:%S") > x1 [1] "2010-04-02 12:00:05" > str(x1) POSIXlt[1:1], format: "2010-04-02 12:00:05" On Wed, Jul 21, 2010 at 8:02 AM, Aaditya Nanduri wrote: > Ms. Chisholm, > > If you could tel

[R] Command that is conditional upon file retrieval: is it possible?

2010-07-21 Thread AndrewPage
Hi all, I'm currently working on an R program where I have to access an FTP server to download some of the data I need. However, the people who post up the files I access are at times inconsistent with regards to time posted, if they post at all, etc Here's some of the code I use: library(

Re: [R] Help me with prediction in linear model

2010-07-21 Thread Dennis Murphy
Hi: On Wed, Jul 21, 2010 at 8:46 AM, vijaysheegi wrote: > > Hi R-community, > I have the code as follows,i Fitted model as follows > lbeer<-log(beer_monthly) > t<-seq(1956,1995.2,length=length(beer_monthly)) #beer_monthly contains 400+ > entries > This is unnecessary: > t2=t^2 > beer_fit_parab

[R] Issues reshaping data

2010-07-21 Thread JGull8502
Hello All, I'm having some trouble reshaping my data from wide to long format. I have tried using both the reshape function and package. Although I haven't worked much with the reshape function, I have found the reshape package useful and intuitive for reshaping data from long to wide format. How

Re: [R] Variance of the prediction in the linear regression model (Theory and programming)

2010-07-21 Thread Yi
Sorry, for the second question. I stated in a wrong way. My aim is the mean and sd of each new observation. # mean=fitted(prediction) ## But I do not know how to get sd for each new observation. Any tips? Thanks Yi On Wed, Jul 21, 2010 at 2:29 PM, Yi wrote: > Hi, folks, > > Here a

Re: [R] Question about allocMatrix error message

2010-07-21 Thread Phil Spector
Moohwan - It appears that you are trying to calculate a 10 by 10 matrix when all you want are the diagonal elements. Here's one approach that might work: s = t(dev)%*%dev/(nr-1) sinv = solve(s) part = sinv%*%t(dev) t2 = dev[,1]*part[1,] + dev[,2]*part[2,]

[R] Variance of the prediction in the linear regression model (Theory and programming)

2010-07-21 Thread Yi
Hi, folks, Here are the codes: ## y=1:10 x=c(1:9,1) lin=lm(log(y)~x) ### log(y) is following Normal distribution x=5:14 prediction=predict(lin,newdata=x) ##prediction=predict(lin) ### 1. The codes do not work, and give the error message: Error in eval(predvars, data, en

Re: [R] Get distribution of positive/negative examples for each cluster

2010-07-21 Thread Phil Spector
Boya- table() is the function that does what you want: cdat = data.frame(membership=rep(1:3,rep(3,3)), + label=as.character(c(0,0,1,0,1,1,1,1,1))) table(cdat) label membership 0 1 1 2 1 2 1 2 3 0 3 From there, you can rearrange it in

[R] xtable

2010-07-21 Thread Silvano
Hi, How do I build a table from a regression model adjusted using xtable? Commands are: modelo1 = lm(Y~X1 + X2) influencia = influence.measures(modelo1) require(xtable) xtable(influencia) but it isn't work. Thanks, -- Silvano Cesar da Costa Departamento

Re: [R] calling R from within Java, using jri

2010-07-21 Thread Hawcandy
I've gotten the same problems when running the examples, the programs just exit after creating Rengine. After trying all the possibilities, I found that I set the environment variable R_HOME wrong. After changing it from C:\Program Files\R\R-2.11.1\bin to C:\Program Files\R\R-2.11.1, the programs

[R] Question about allocMatrix error message

2010-07-21 Thread Moohwan Kim
Dear R family, I faced a technical problem in r coding. #s=t(dev)%*%dev/(nr-1) # dev (100,000 by 2) stands for deviation from the mean #sinv=solve(s) #t2=diag(dev%*%sinv%*%t(dev)) I got an error message at t2 statement: Error in diag(dev %*% si %*% t(dev)) : allocMatrix: too many eleme

Re: [R] RGoogleDocs ability to write to spreadsheets broken as of yesterday

2010-07-21 Thread David Scott
Henrique Dallazuanna wrote: On Wed, Jul 21, 2010 at 11:24 AM, Ben Bolker wrote: Harlan Harris harris.name> writes: Hi, I'm using RGoogleDocs/RCurl to update a Google Spreadsheet. Everything worked OK until this morning, when my ability to write into spreadsheet cells went away. I get the f

[R] .jinit and .jnew

2010-07-21 Thread behrooz
i have a jar under z:/downloads/AA, i use .jinit(classpath="z:/downloads/AA") and then .jnew("Myclass") but .jnew throes an error: Error in .jnew("MyClass") : java.lang.NoClassDefFoundError: MyClass tried .jinit(classpath="z:/downloads/AA/myClass.jar") and got the same error. any idea?

Re: [R] Chi-square distribution probability density function:

2010-07-21 Thread Knut Krueger
David Winsemius schrieb: And exactly why did you think I offered ?Chisquare I was completely on the wrong way, and tried to find a solution with the formula instead to substitute the formula. So I tried to implement pchisq into the formula - and of course I got wrong values ... Thank's K

Re: [R] Objects within environment

2010-07-21 Thread Megh Dal
Thanks Duncan, I understood. Your explanation is really great. Thank you so much for your time. --- On Wed, 7/21/10, Duncan Murdoch wrote: > From: Duncan Murdoch > Subject: Re: [R] Objects within environment > To: "Megh Dal" > Cc: r-h...@stat.math.ethz.ch > Date: Wednesday, July 21, 2010, 10:

Re: [R] Objects within environment

2010-07-21 Thread Megh Dal
Hi Duncan, thanks for your clarification. However I do not think I could really understand the "envir" argument in objects() function. It is saying "an alternative argument for name" Is the "alternative" means the alternative of, let say, "package:graphics" (which is the name of an

Re: [R] Lattice Panel Print Order

2010-07-21 Thread Mark Ebbert
For pete's sake! That's just embarrassing. I don't know how I missed that. Thanks for your help Deepayan. I would also like to say thank you for supporting Lattice so well. On Jul 21, 2010, at 2:39 AM, Deepayan Sarkar wrote: > On Wed, Jul 21, 2010 at 12:13 AM, Mark Ebbert > wrote: >> Hi, >>

Re: [R] sem by variable x

2010-07-21 Thread Daniel Caro
Hi Jarret, Thank you for your answer. I get the following message: Error in cov(a.df[, 2:7], nrow(a.df)) : incompatible dimensions The function seems to run for some countries but then appears to stop when a country has incomplete data (1 var is missing, for example). How to force the function t

[R] "lmomRFA" package: error bounds/confidence intervals

2010-07-21 Thread Tonja Krueger
Dear List I’m using the ”lmomRFA” package to fit different distributions to my data sample. To calculate the error bounds I used: regsimq(…) and sitequantbounds(…) So my questions are: Are error bounds and confidence intervals the same thing? And: Does regsimq(… boundprob = c(0.05,

[R] Help me with prediction in linear model

2010-07-21 Thread vijaysheegi
Hi R-community, I have the code as follows,i Fitted model as follows lbeer<-log(beer_monthly) t<-seq(1956,1995.2,length=length(beer_monthly)) #beer_monthly contains 400+ entries t2=t^2 beer_fit_parabola=lm(lbeer~t+t2) Below is not working for me. Please help me in preparing the new data set for t

[R] Get distribution of positive/negative examples for each cluster

2010-07-21 Thread Boya Sun
Dear R experts, I have a labeled data set. Each data is assigned a binary label 0 or 1. Assume that I use some clustering algorithm to group the data by clusters (using some features of the data). Now I want to know how many data are labeled as 0/1 in each cluster. For example, assume that I have

Re: [R] lm: order of dropped columns

2010-07-21 Thread Dennis Murphy
Hi: (1) lm() drops columns in a rank-deficient model matrix X to make X'X nonsingular - this is called a full-rank reparameterization of the linear model. (2) How many columns of X are dropped depends on its rank, which in turn depends on the number of constraints in the model matrix. This is rel

[R] Converting Between Character and Numeric Objects

2010-07-21 Thread Erin
Hello, I'm trying to convert a vector of string objects to a numeric object by initializing the variables with values. I use the function below to scan through a matrix and create mass action flux relationships: makeMassActionFluxes = function(sMatrix) { #Allocate a matrix with identical dimens

[R] prediction from a logistic mixed effects model

2010-07-21 Thread kdionisio
Hi, Is there any similar command to "predict" which can be used with a logistic random effects model? I have run a random effects model using "lme()", and then use "predict.lme()" with no problems. However, I would also like to run a logistic random effects model, and then also run a predict com

Re: [R] RGoogleDocs ability to write to spreadsheets broken as of yesterday - CAN PAY FOR FIX

2010-07-21 Thread Harlan Harris
*Thank you*! Yes, version 1.4-3 of RCurl solves this problem! If you put a tip jar on OmegaHat, Duncan, I will seriously kick a few bucks your way. Getting my code back running will save me a lot of time and anxiety! Thanks for all y

Re: [R] Problem with invoking R from the command line (Windows Vista) - - SORTED!

2010-07-21 Thread Camster
Thanks for suggestion. It was indeed a path problem. I move R into a directory without spaces and added the directory RHOME\bin in the Path environment variable. All sorted. -- View this message in context: http://r.789695.n4.nabble.com/Problem-with-invoking-R-from-the-command-line-Windows-V

Re: [R] Interactions in GAMMs

2010-07-21 Thread Gavin Simpson
On Wed, 2010-07-21 at 16:17 +0100, Karen Moore wrote: > Hi, > > I've an issue adding an interaction to a GAMM: > > My model was of form: > > gamm1 <- gamm(TOTSR ~ fROT + s(PH) + s(LOI) + s(ASP) + s(SQRT_ELEV) + CANCOV > + s(SQRT_TOTCWD) + s(WELLF) + s(WELLN) + s(OLDWDLD) + s(DISTWOOD) + > s(Annp

Re: [R] Objects within environment

2010-07-21 Thread Bert Gunter
> Can you please explain me in simple english? I think R help file should use more non-technical simple english language so that student like me can understand R in more easier way! -- Megh (and others): Without judging this particular issue, writing good technical documentation -- whether it be

Re: [R] RGoogleDocs ability to write to spreadsheets broken as of yesterday - CAN PAY FOR FIX

2010-07-21 Thread Duncan Temple Lang
Hi Harlan If you install the latest version of RCurl from source via install.packages("RCurl", repos = "http://www.omegahat.org/R";) and that should solve the problem, assuming I have been reproducing the same problem you mentioned. You haven't mentioned what operating system your are o

Re: [R] String processing - is there a better way

2010-07-21 Thread Gabor Grothendieck
On Wed, Jul 21, 2010 at 1:02 PM, Davis, Brian wrote: > I have a two part question > > Part 1) > I am trying to remove characters in a string based on the position of a key > character in another string.  I have a solution that works but it requires a > for-loop.  A vectorized way of doing this h

Re: [R] The opposite of "lag"

2010-07-21 Thread Dimitri Liakhovitski
Thanks a lot, it's very helpful! On Wed, Jul 21, 2010 at 1:21 PM, Gabor Grothendieck wrote: > On Wed, Jul 21, 2010 at 1:16 PM, Dimitri Liakhovitski > wrote: >> I reinstalled zoo and now I can see the years on left (raw names). >> Before - I could not see them. >> Thank you! > > Note that the res

Re: [R] Chi-square distribution probability density function:

2010-07-21 Thread David Winsemius
On Jul 21, 2010, at 1:18 PM, Knut Krueger wrote: David Winsemius schrieb: And exactly why did you think I offered ?Chisquare I was completely on the wrong way, and tried to find a solution with the formula instead to substitute the formula. So I tried to implement pchisq into the formul

Re: [R] The opposite of "lag"

2010-07-21 Thread Gabor Grothendieck
On Wed, Jul 21, 2010 at 1:16 PM, Dimitri Liakhovitski wrote: > I reinstalled zoo and now I can see the years on left (raw names). > Before - I could not see them. > Thank you! Note that the result is a zoo object. A zoo object consists of data (which is everything except the years, here) and the

Re: [R] Problem with invoking R from the command line (Windows Vista)

2010-07-21 Thread Gabor Grothendieck
On Wed, Jul 21, 2010 at 12:55 PM, Camster wrote: > > Dear all > > I am running in a problem when trying to run R from Windows command line. > I am runnning Windows Vista, R-2.10.1. > > I have a script I would like to run remotely from another program. As it did > not work, I thought I would test t

Re: [R] The opposite of "lag"

2010-07-21 Thread Dimitri Liakhovitski
I reinstalled zoo and now I can see the years on left (raw names). Before - I could not see them. Thank you! On Wed, Jul 21, 2010 at 12:51 PM, Gabor Grothendieck wrote: > On Wed, Jul 21, 2010 at 12:18 PM, Dimitri Liakhovitski > wrote: >> Sorry, I don't think it's working. >> the last 3 columns (

Re: [R] Problem with invoking R from the command line (Windows Vista)

2010-07-21 Thread Duncan Murdoch
On 21/07/2010 12:55 PM, Camster wrote: Dear all I am running in a problem when trying to run R from Windows command line. I am runnning Windows Vista, R-2.10.1. I have a script I would like to run remotely from another program. As it did not work, I thought I would test the script from the Wi

[R] String processing - is there a better way

2010-07-21 Thread Davis, Brian
I have a two part question Part 1) I am trying to remove characters in a string based on the position of a key character in another string.  I have a solution that works but it requires a for-loop.  A vectorized way of doing this has alluded me.  CleanRead<-function(x,y) {   if (!is.characte

Re: [R] [SPAM](Aktien) Re: Chi-square distribution probability density function:

2010-07-21 Thread David Winsemius
On Jul 21, 2010, at 12:36 PM, Knut Krueger wrote: David Winsemius schrieb: On Jul 21, 2010, at 6:52 AM, Knut Krueger wrote: Hi to all I found an formular of an ** ***p-Value Calculator for the Chi-Square test* *http://www.danielsoper.com/statcalc/calc11.aspx* *with the formula*

[R] Problem with invoking R from the command line (Windows Vista)

2010-07-21 Thread Camster
Dear all I am running in a problem when trying to run R from Windows command line. I am runnning Windows Vista, R-2.10.1. I have a script I would like to run remotely from another program. As it did not work, I thought I would test the script from the Windows command line which highlighted a pr

Re: [R] RGoogleDocs ability to write to spreadsheets broken as of yesterday - CAN PAY FOR FIX

2010-07-21 Thread Duncan Temple Lang
Hi Harlan Can you send some code so that we can reproduce the problem. That will enable me to fix the problem quicker. D. On 7/21/10 8:26 AM, Harlan Harris wrote: > I unfortunately haven't received any responses about this problem. We > (the company I work for) are willing to discuss payment

Re: [R] The opposite of "lag"

2010-07-21 Thread Gabor Grothendieck
On Wed, Jul 21, 2010 at 12:18 PM, Dimitri Liakhovitski wrote: > Sorry, I don't think it's working. > the last 3 columns (on the right) of result contain the original data > of each group. > But there is no shift at all. I am trying to reach the following > result for each group: The first number d

Re: [R] Objects within environment

2010-07-21 Thread Duncan Murdoch
On 21/07/2010 12:27 PM, Megh Dal wrote: Hi Duncan, thanks for your clarification. However I do not think I could really understand the "envir" argument in objects() function. It is saying "an alternative argument for name" Is the "alternative" means the alternative of, let say, "pa

Re: [R] Constrain density to 0 at 0?

2010-07-21 Thread Ravi Varadhan
This is the "boundary" problem in density estimation. One simple trick is to use the idea of "reflection". If your data is (y1, y2, ...,yn), you create a reflected data by appending `n' negative values to your data, call this y*. Estimate the kernel density for this as fhat(y*). Redefine thi

Re: [R] The opposite of "lag"

2010-07-21 Thread Dimitri Liakhovitski
Basically, if you look at the A lagged below, then you see how in each group the values of A "move" downwards": and NA is added on top and the last value in each group disappears. I am trying to get the opposite: the first value in each group disappears and NA is added at the bottom. D. set.seed(1

Re: [R] RGoogleDocs ability to write to spreadsheets broken as of yesterday

2010-07-21 Thread Ben Bolker
On Wed, Jul 21, 2010 at 10:38 AM, Henrique Dallazuanna wrote: > > Maybe: > packageDescription('RGoogleDocs', fields = 'Author') > >> or rather packageDescription('RgoogleDocs', fields='Maintainer') (usually but not always the same person) thanks Ben ___

Re: [R] The opposite of "lag"

2010-07-21 Thread Dimitri Liakhovitski
Sorry, I don't think it's working. the last 3 columns (on the right) of result contain the original data of each group. But there is no shift at all. I am trying to reach the following result for each group: The first number disappears and at the bottom an NA appears. Is it possible? On Wed, Jul 2

Re: [R] The opposite of "lag"

2010-07-21 Thread Dimitri Liakhovitski
Never mind- I figured it out: A library(zoo) z <- read.zoo(A, index = 1, split = "group", frequency = 1) z <- as.zooreg(z) ### result<-lag(z, c(-1, 0, 1)) A result Thank you very much! On Wed, Jul 21, 2010 at 12:08 PM, Dimitri Liakhovitski wrote: > Thank you, Gabor, but sorry - what is the exac

Re: [R] The opposite of "lag"

2010-07-21 Thread Dimitri Liakhovitski
Thank you, Gabor, but sorry - what is the exact order of those rows again? Thank you! Dimitri On Wed, Jul 21, 2010 at 11:59 AM, Gabor Grothendieck wrote: > On Wed, Jul 21, 2010 at 10:50 AM, Gabor Grothendieck > wrote: >> On Wed, Jul 21, 2010 at 10:14 AM, Dimitri Liakhovitski >> wrote: >>> Hello

Re: [R] The opposite of "lag"

2010-07-21 Thread Gabor Grothendieck
On Wed, Jul 21, 2010 at 10:50 AM, Gabor Grothendieck wrote: > On Wed, Jul 21, 2010 at 10:14 AM, Dimitri Liakhovitski > wrote: >> Hello! >> >> I have a data frame A (below) with a grouping factor (group). I take >> my DV and create the new, lagged DV by applying the function lag.it >> (below). It

[R] Default For list.len Argument ("list output truncated")

2010-07-21 Thread Soeren . Vogel
Hello How can I set a default for the 'list.len' argument in 'str'? x <- as.data.frame(matrix(1:1000, ncol=1000)) str(x) formals(str) <- alist(object=, ...=, list.len=1000) args(str); formals(str) str(x) Does not display errors, but does not work either. Thanks for help Sören

Re: [R] Interactions in GAMMs

2010-07-21 Thread David Winsemius
On Jul 21, 2010, at 11:17 AM, Karen Moore wrote: Hi, I've an issue adding an interaction to a GAMM: My model was of form: # Package? Probably: require(mgcv) gamm1 <- gamm(TOTSR ~ fROT + s(PH) + s(LOI) + s(ASP) + s(SQRT_ELEV) + CANCOV + s(SQRT_TOTCWD) + s(WELLF) + s(WELLN) + s(OLDWDLD)

[R] lm: order of dropped columns

2010-07-21 Thread Anirban Mukherjee
Hi all, If presented with a singular design matrix, lm drops columns to make the design matrix non-singular. What algorithm is used to select which (and how many) column(s) to drop? Particularly, given a factor, how does lm choose levels of the factor to discard? Thanks for the help. Best, Anirb

Re: [R] Interactions in GAMMs

2010-07-21 Thread Vito Muggeo (UniPa)
Hi Karen, I think you should decide what you mean for "interaction". s(x:y) is meaningless If you want to fit a surface you should use s(x,y). If you want to fit a varying coefficient model (interaction between a linear and a smooth term) you should use the argument by in s(). The help file

Re: [R] RGoogleDocs ability to write to spreadsheets broken as of yesterday - CAN PAY FOR FIX

2010-07-21 Thread Harlan Harris
I unfortunately haven't received any responses about this problem. We (the company I work for) are willing to discuss payment to someone who is willing to quickly contribute a fix to the RGoogleDocs/RCurl toolchain that will restore write access. Please contact me directly if you're interested. Tha

[R] Interactions in GAMMs

2010-07-21 Thread Karen Moore
Hi, I've an issue adding an interaction to a GAMM: My model was of form: gamm1 <- gamm(TOTSR ~ fROT + s(PH) + s(LOI) + s(ASP) + s(SQRT_ELEV) + CANCOV + s(SQRT_TOTCWD) + s(WELLF) + s(WELLN) + s(OLDWDLD) + s(DISTWOOD) + s(Annprec) + s(OLDWDLD:DISTWOOD) + (1|fSITE), family = poisson, data = BIOFOR

Re: [R] Help with time in R

2010-07-21 Thread Aaditya Nanduri
Ms. Chisholm, If you could tell us how you plan to use the variables, we will have a better understanding of what you are looking for and will be able to help you. Are you looking for the time in seconds? In that case, do as Mr. Holfman says. He just skipped the part about converting the factors t

Re: [R] best way to apply a list of functions to a dataset ?

2010-07-21 Thread Hadley Wickham
> ddply(ma, .(variable), summarise, mean = mean(value), sd = sd(value), >       skewness = skewness(value), median = median(value), >       mean.gt.med = mean.gt.med(value)) In principle, you should be able to do: ddply(ma, .(variable), colwise(each(mean, sd, skewness, median, mean.gt.med))) but

Re: [R] The opposite of "lag"

2010-07-21 Thread Gabor Grothendieck
On Wed, Jul 21, 2010 at 10:14 AM, Dimitri Liakhovitski wrote: > Hello! > > I have a data frame A (below) with a grouping factor (group). I take > my DV and create the new, lagged DV by applying the function lag.it > (below). It works fine. > > A <- data.frame(year=rep(c(1980:1984),3), group= > fac

[R] Clustering groups

2010-07-21 Thread syrvn
Hi, is there a way in R to identify those cluster methods / distance measures which best reflect predefined cluster groups. Given 10 observations O1...O10. Optimally, these 10 observations cluster as follows: cluster1: O1, O2, O3, O4 cluster2: O5, O6 cluster3: O7, O8, O9, O10. What I want is a

Re: [R] RGoogleDocs ability to write to spreadsheets broken as of yesterday

2010-07-21 Thread Henrique Dallazuanna
On Wed, Jul 21, 2010 at 11:24 AM, Ben Bolker wrote: > Harlan Harris harris.name> writes: > > > > > Hi, > > > > I'm using RGoogleDocs/RCurl to update a Google Spreadsheet. Everything > > worked OK until this morning, when my ability to write into spreadsheet > > cells went away. I get the followi

Re: [R] RGoogleDocs ability to write to spreadsheets broken as of yesterday

2010-07-21 Thread Ben Bolker
Harlan Harris harris.name> writes: > > Hi, > > I'm using RGoogleDocs/RCurl to update a Google Spreadsheet. Everything > worked OK until this morning, when my ability to write into spreadsheet > cells went away. I get the following weird error: > > Error in els[[type + 1]] : subscript out of bo

Re: [R] best way to apply a list of functions to a dataset ?

2010-07-21 Thread Peter Ehlers
Dennis' ddply solution would be my choice. Here is a small variation that makes it easy to modify what list of functions is applied: # ma<- melt(attitude) f <- function(x,v) summarise(x, mean = mean(v), sd = sd(v), skewness = skewness(v), mean.gt.med = mean.gt.med(v) ) d

[R] How do you calculate DIC from coda files (R2WinBUGS)?

2010-07-21 Thread Patrick McKann
I tried calculating pD as 1/2 variance of the deviance, but I got hugely inflated numbers. Does anybody know how to calculate pD from the coda files output from R2WinBUGS? By the way, 'set DIC' is greyed out for some reason within WinBUGS, so I can't monitor DIC. [[alternative HTML vers

[R] The opposite of "lag"

2010-07-21 Thread Dimitri Liakhovitski
Hello! I have a data frame A (below) with a grouping factor (group). I take my DV and create the new, lagged DV by applying the function lag.it (below). It works fine. A <- data.frame(year=rep(c(1980:1984),3), group= factor(sort(rep(1:3,5))), DV=c(rnorm(15))) lag.it <- function(x) { DV <- ts(x$

Re: [R] Error message: attempt to set rownames on object with no dimensions

2010-07-21 Thread David Winsemius
On Jul 21, 2010, at 9:39 AM, Igor Blanco wrote: Hi there, I am trying to analyze some data using the lme package. In my case there is a variable called Newmarker that can only take 2 values (number 1 or number 2). I have used the as.factor to remark this fact but an error message appears

Re: [R] Error message: attempt to set rownames on object with no dimensions

2010-07-21 Thread Prof Brian Ripley
?lme (at least the one in package nlme) seems not to mention that the response in 'fixed' must be a numeric variable, but it must (and a factor is not numeric). If you want to use a binary response, you need to use other methods, and it would be better to ask on R-sig-mixed-models making clear

[R] Error message: attempt to set rownames on object with no dimensions

2010-07-21 Thread Igor Blanco
Hi there, I am trying to analyze some data using the lme package. In my case there is a variable called Newmarker that can only take 2 values (number 1 or number 2). I have used the as.factor to remark this fact but an error message appears stating: attempt to set rownames on object with no dimens

[R] Piecewise regression using lme()

2010-07-21 Thread goulvenS
Hi everyone, I'm trying to fit a of piecewise regression model on a time series. The idea is to divide the series into segments and then to apply linear regression models on each segment but in a "global way" and considering heteroskedasticity between the segments. For example, I build a time ser

[R] R Cheat Sheets and Reference Cards

2010-07-21 Thread Tim Church
FYI - There is a new collection of free cheat sheets and reference cards for R on DevCheatSheet - http://devcheatsheet.com/tag/r/ If anyone knows of any other R cheat sheets that are not listed, please use the 'Suggest a Missing Cheat Sheet' link on the site. [[alternative HTML version de

[R] Fractional Polynomials - Hazard Ratios and Relative Hazard Plots

2010-07-21 Thread Laura Bonnett
Dear All, I am using Windows and R version 2.9.2 with libraries cmprsk, mfp and Design. I have a dataset with approximately 1700 patients (1 row per patient) and I have 12 outcomes, three of which are continuous. I have performed univariate analyses to see if any factors are associated with a hi

[R] DIF Analysis starting from a gpcm class object

2010-07-21 Thread Dr. Federico Andreis
Dear useRs, does any of you have suggestions on how to conduct a proper DIF analysis starting from a model of class gpcm (from the wonderful package ltm by prof. Rizopoulos)? difR will handle only dichotomous items, and I have a mix of dicho- and polytomous ones (that's why I chose the partial

Re: [R] how to unsubscribe

2010-07-21 Thread barbara horta e costa
I already changed my email account. Thanks a lot On 21 July 2010 12:50, Jannis wrote: > As in nearly every e-mail list, you just need to click on one of the links > at the end of each mail (its the first link in this case) and follow the > instructions. > > > Jannis > > --- barbara horta e costa

[R] fix()ing an S4 method

2010-07-21 Thread Albert-Jan Roskam
Hi R experts,   The fix() function canbe used to edit normal functions. I would like to know whether it's also possible to use something similar to edit a method of an S4 class. In other words, is there a fix-like function that allows me to edit method definitions without having to go back to th

[R] Saving R plots as image in oracle database tables

2010-07-21 Thread vikrant
Dear All, I want to know how to save R plots as image/object in a oracle database?? I am using RODBC package for connecting R to oracle Please explain by giving example.. Thanks in advance Cheers, Vikrant -- View this message in context: http://r.789695.n4.nabble.com/Saving-R-plots-as-image-in

Re: [R] Random Forest - Strata

2010-07-21 Thread mxkuhn
If you use the index argument of the trainControl() function in the caret package, the train() function can be used for this type of resampling (and you'll get some decent summaries and visualizations to boot) Max On Jul 21, 2010, at 7:11 AM, "Tim Howard" wrote: > Coll, > > An alternative ap

Re: [R] how to unsubscribe

2010-07-21 Thread Jannis
As in nearly every e-mail list, you just need to click on one of the links at the end of each mail (its the first link in this case) and follow the instructions. Jannis --- barbara horta e costa schrieb am Mi, 21.7.2010: > Von: barbara horta e costa > Betreff: [R] how to unsubscribe > An: r

Re: [R] Contingency Table Analysis - specific cell to specific cell comparisons

2010-07-21 Thread David Winsemius
On Jul 21, 2010, at 8:07 AM, Tsunhin John Wong wrote: Dear R users, I have a question of how to do some specific cell to cell comparisons on a R x C contingency table. The table is a 3 x 5 table with frequency / count data. langcons.table <- table(lang, cons) langcons.table[cbind(lang,cons)]

  1   2   >