Re: [R] Ifelse on matrix using a vector argument

2012-06-06 Thread Özgür Asar
A generalized procedure for real life datasets might be out-rep(matrix(arg),ncol(ma))-ma out[which(arg==0),]--out[which(arg==0),] out Ozgur -- View this message in context: http://r.789695.n4.nabble.com/Ifelse-on-matrix-using-a-vector-argument-tp4632485p4632490.html Sent from the R help

Re: [R] mgcv (bam) very large standard error difference between versions 1.7-11 and 1.7-17, bug?

2012-06-06 Thread Martijn Wieling
Dear useRs, I ran an additional analysis with another dataset and (logistic regression), but also in this case I obtain very different p-values comparing version 1.7-11 and 1.7-17. Any ideas about this? Which is the good one? Below, I'll first show the model based on 1.7-11, then of version

[R] changing axis labels

2012-06-06 Thread Alaios
Dear all, I am making a function for creating plots and part of this function is to change the labels to x axis that instead of number contains percentage number. I want to change the x axis to depict the percentage value of the presented data x-c(501:600) y-c(201:300) plot(x,y,axes=F)

Re: [R] regression methods for rare events?

2012-06-06 Thread Xavier Fernández i Marín
David Studer vas escriure el dia dl, 04 jun 2012: Hi everybody! I have a sample with n=2.000. This sample contains rare events (10, 20, 30 individuals with a specific illness). Now I'd like to do a logistic regression in order to identify risk factors. I have several independent variables

Re: [R] regression methods for rare events?

2012-06-06 Thread Özgür Asar
relogit procedure under package Zelig ? Best Ozgur -- View this message in context: http://r.789695.n4.nabble.com/regression-methods-for-rare-events-tp4632332p4632501.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] R Error, very odd....

2012-06-06 Thread Nane
I had the exact same error message, and figured out that the problem was coming from one of my cell being filled with a Na instead of a NA. -- View this message in context: http://r.789695.n4.nabble.com/R-Error-very-odd-tp887545p4632492.html Sent from the R help mailing list archive at

[R] How to Read command line parameters in Sweave?

2012-06-06 Thread Manish Gupta
Hi, I want to read command line parameter in Sweave. How this can be done. R CMD Sweave input.Rnw parameter1 paramter2 Regards -- View this message in context: http://r.789695.n4.nabble.com/How-to-Read-command-line-parameters-in-Sweave-tp4632493.html Sent from the R help mailing list

Re: [R] plz help. how to filter/group/sort data on mass data

2012-06-06 Thread bestbird
thank you. diff can do this -- View this message in context: http://r.789695.n4.nabble.com/plz-help-how-to-filter-group-sort-data-on-mass-data-tp4630714p4632494.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org

[R] problem about set operation and computation after split

2012-06-06 Thread bestbird
hi, I met some problems in R, plz help me. 1. How to do a intersect operation among several groups in one list, without a loop statement? (I think It may be a list) create data: myData - data.frame(product = c(1,2,3,1,2,3,1,2,2),

Re: [R] Piecewise Lasso Regression

2012-06-06 Thread Vito Muggeo (UniPa)
dear lucas, yes you are right, segmented does not handle 'lars' objects. Out of curisity, are you interested in selecting the number of breakpoints or in selecting additional covariates with linear parameters? vito Il 06/06/2012 0.01, Lucas Santana dos Santos ha scritto: Hi All, I am

Re: [R] how to ignore NA with NA or NULL

2012-06-06 Thread jeff6868
Hello, I added your flags in my code but there are still errors. Actually I tried some things: - in function na.fill, I changed: if(all(!is.na(y[1:8700,1]))) return(NA) to if(all(!is.finite(y[1:8700,1]))) return(y) In order to have this file unchanged. It has removed my dimension problem.

Re: [R] How do I obtain the current active path of a function that's being called?

2012-06-06 Thread Gabor Grothendieck
On Tue, Jun 5, 2012 at 4:58 PM, Michael comtech@gmail.com wrote: Hi all, How do I obtain the current active path of a function that's being called? That's to say, I have several source files and they all contain definition of function A. I would like to figure out which function A and

[R] vis.gam() plot graph of differences??

2012-06-06 Thread Mabille, Geraldine
Dear all, I'm using gam models to test for a by-factor interaction and then plotting the results using vis.gam(). The y variable is binomial and I use models of this sort: Mod1-gam(y~Factor+te(x1,x2, by=Factor) +s(Group,bs=re),data=mydata,family=binomial(link=logit),method=REML)

[R] how to add a vertical line for each panel in a lattice dotplot with log scale?

2012-06-06 Thread maxbre
by considering this example from barley dataset #code start dotplot(variety ~ yield | site, data = barley, scales=list(x=list(log=TRUE)), layout = c(1,6), panel = function(...) { panel.dotplot(...) #median.values - tapply(x, y, median)# medians

Re: [R] changing axis labels

2012-06-06 Thread John Kane
box() at end of code John Kane Kingston ON Canada -Original Message- From: ala...@yahoo.com Sent: Wed, 6 Jun 2012 00:40:53 -0700 (PDT) To: r-help@r-project.org Subject: [R] changing axis labels Dear all, I am making a function for creating plots and part of this function is to

Re: [R] Combine subsets by factor level

2012-06-06 Thread John Kane
We really should have some sample data (see dput() for a handy way to post some). However have a look at ?reshape, the plyr and reshape packages or perhaps the data.table package. John Kane Kingston ON Canada -Original Message- From: libgray3...@gmail.com Sent: Tue, 5 Jun 2012

Re: [R] how to ignore NA with NA or NULL

2012-06-06 Thread Jeff Newmiller
Please read the posting guide mentioned at the bottom of every message. You might also benefit from reading http://stackoverflow.com/questions/5963269/how-to-make-a-great-reproducible-example. We would certainly benefit from not having to guess what problems you are really encountering. Also,

Re: [R] ggplot incorrect legend

2012-06-06 Thread John Kane
You are from the jpeg you link as far as I can see.. What exactly is the output that you expect in the legend John Kane Kingston ON Canada -Original Message- From: ja...@crosb.ie Sent: Tue, 5 Jun 2012 20:18:55 -0700 (PDT) To: r-help@r-project.org Subject: [R] ggplot incorrect

Re: [R] changing axis labels

2012-06-06 Thread Alaios
Great :) To: R help R-help@r-project.org Sent: Wednesday, June 6, 2012 9:40 AM Subject: changing axis labels Dear all, I am making a function for creating plots and part of this function is to change the labels to x axis that instead of number contains

Re: [R] Chi square value of anova(binomialglmnull, binomglmmod, test=Chisq)

2012-06-06 Thread lincoln
David Winsemius wrote This is making me think you really have multiple observation on the same individuals (and that persons make transitions from one state to another as a result of the passage of time. That needs a more complex analysis than simple logistic regression. You might

Re: [R] Fourier descriptors created in a loop

2012-06-06 Thread aledanda
Hi David, Thank you for your reply. /Somehow I'm guessing that this will involve load an unnamed package. Yep: ?create.fourier.descriptor No documentation for ‘create.fourier.descriptor’ in specified packages and libraries: you could try ‘??create.fourier.descriptor’/ So I indeed forgot

[R] error calling Winbugs using R2WinBugs to run a multi-level model

2012-06-06 Thread Saana Isojunno
Dear all, I'm calling Winbugs (1.4.3) through R2WinBugs (2.1-18 coda_0.14-7) to fit a switching random walk model, but come up with an instant trap with the log only displaying 'check('. I will paste the trap with session info below; I'd be very grateful for any ideas. Couple of leads: 1. I

Re: [R] R-help Digest, Vol 112, Issue 6

2012-06-06 Thread David L Lorenz
Rich, The documentation for cenboxplot states that the second argument must be logical and not integer. the function cenboxplot substitutes synthetic values for censored values using ros, hence the error message from the ros method. I also do not understand how you expect group = 'SO4' to

[R] randomForest Species Distribution Modelling

2012-06-06 Thread Fionn
Hi, I appologise if this is a rudimentary question and long winded but I just wanted to let ye know where I'm comming from. I'm new to R and I'm trying to use the 'randomForest' package to classify and predict. The Error message that is troubling me is: pr-predict(predictors,rf1, ext=ext) Error

[R] cluster algorithm with fixed cluster size

2012-06-06 Thread Martin Guetlein
Hi all, Does anyone know a cluster algorithm in R that allows to set the cluster size (not the number of clusters) to a fixed value? With best regards, Martin -- Dipl-Inf. Martin Gütlein Phone: +49 (0)761 203 7633 (office) +49 (0)177 623 9499 (mobile) Email:

Re: [R] How to Read command line parameters in Sweave?

2012-06-06 Thread manish gupta
I don't want to use it as manual. I want my software to automated. On Wed, Jun 6, 2012 at 9:13 PM, Yihao Lu yihao...@gmail.com wrote: you use this list as your manual? On Wed, Jun 6, 2012 at 2:31 AM, Manish Gupta mandecent.gu...@gmail.com wrote: Hi, I want to read command line

Re: [R] how to ignore NA with NA or NULL

2012-06-06 Thread jeff6868
Ok Jeff, but then it'll be a big one. I'm working on a list of files and my problem depends on different functions used previously. So it's very hard for me to summarize to reproduct my error. But here is the reproductible example with the error at the last line of the code (just copy and paste

Re: [R] [r] par and complex graph

2012-06-06 Thread Francesco Nutini
Thank you Brian! So, that's why sometimes I can't use the par() Now I'm using the ternaryplot in [vcd]. Then, I have to read the vcd help to looking for a function similar to par(). Many thanks. Francesco Date: Tue, 5 Jun 2012 19:01:25 +0100 From: rip...@stats.ox.ac.uk To:

Re: [R] Chi square value of anova(binomialglmnull, binomglmmod, test=Chisq)

2012-06-06 Thread peter dalgaard
On Jun 6, 2012, at 10:59 , lincoln wrote: David Winsemius wrote This is making me think you really have multiple observation on the same individuals (and that persons make transitions from one state to another as a result of the passage of time. That needs a more complex analysis

Re: [R] how to add a vertical line for each panel in a lattice dotplot with log scale?

2012-06-06 Thread ilai
You say median for each panel but tapply gets medians for each variety (chartjunk IMHO). Regardless, *this case* has nothing to do with panel.abline. Add print(median.values) to your panel function would have hinted as to the missing piece. # medians for each panel: dotplot(variety ~ yield |

Re: [R] ggplot incorrect legend

2012-06-06 Thread jcrosbie
I'm expecting the legend to be 1,2,4,5,10 not 2,4,6,8,10. Is there away I can set my own colour and legend tittles? -- View this message in context: http://r.789695.n4.nabble.com/ggplot-incorrect-legend-tp4632471p4632529.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] How to Read command line parameters in Sweave?

2012-06-06 Thread Yihao Lu
you use this list as your manual? On Wed, Jun 6, 2012 at 2:31 AM, Manish Gupta mandecent.gu...@gmail.com wrote: Hi, I want to read command line parameter in Sweave. How this can be done. R CMD Sweave input.Rnw   parameter1  paramter2 Regards -- View this message in context:

Re: [R] Piecewise Lasso Regression

2012-06-06 Thread Lucas Santana dos Santos
Hi Vito, I am more interested in selecting the number of breakpoints. My data has some structure and I believe that fitting a piecewise regression would be of great benefit. Thanks, Lucas On Jun 6, 2012, at 4:54 AM, Vito Muggeo (UniPa) wrote: dear lucas, yes you are right, segmented does

Re: [R] How to find best parameter values using deSolve n optim() ?

2012-06-06 Thread mhimanshu
Hello Thomas, This code seems to be fine and its now working well. I read the about the FME package, but I have one doubt, as in the data set given in the paper, it showing a nice kinetics of the viral growth, so my question is what if there is a sudden increase in viral growth after some

[R] ARCH modelling/MA process

2012-06-06 Thread and_mue
Hi all ARCH modelling I have a problem now on how to proceed with further steps in my analysis. I did a linear OLS regression with my daily data of stock and index returns. There is now the problem of arch in my error terms. Thus I used the following r command: garch(resid_desn, order=c(0,2))

Re: [R] error calling Winbugs using R2WinBugs to run a multi-level model

2012-06-06 Thread ilai
Untested because I don't have (use) winbugs and you didn't provide dat*. But consider a - 4 ; f - 6 list('a','f') list(a,f) list(a=a,f=f) My guess is you wanted sp.data to be a named list, not a list of names... HTH On Wed, Jun 6, 2012 at 4:12 AM, Saana Isojunno saana.isoju...@googlemail.com

Re: [R] Fourier descriptors created in a loop

2012-06-06 Thread Jeff Newmiller
It would help if you read the manual page for png and gave it arguments that matched what the function expects. You probably also need to read ?paste. Also, based on what you have said so far, you do NOT need nested for loops. Just use the inner loop and when you need i use instead

Re: [R] how to ignore NA with NA or NULL

2012-06-06 Thread Jeff Newmiller
Still not clear what solution you would consider a success. On the one hand, you said you needed the NULLs, but you want one big data frame also. Does refill - refill[ -which( sapply( refill, is.null ), arr.ind=TRUE ) ) ] refill - as.data.frame( refill ) do what you want? If you need to keep

Re: [R] cluster algorithm with fixed cluster size

2012-06-06 Thread Özgür Asar
Hi, See the package cluster in R. Ozgur -- View this message in context: http://r.789695.n4.nabble.com/cluster-algorithm-with-fixed-cluster-size-tp4632523p4632540.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org

Re: [R] How to Read command line parameters in Sweave?

2012-06-06 Thread Jessica Streicher
http://stackoverflow.com/questions/9399459/r-sweave-arguments google is your friend ;) Am 06.06.2012 um 15:29 schrieb manish gupta: I don't want to use it as manual. I want my software to automated. On Wed, Jun 6, 2012 at 9:13 PM, Yihao Lu yihao...@gmail.com wrote: you use this list as

[R] Problem with tune function in e1071 package

2012-06-06 Thread Guido Leoni
Dear list I'm classifying some data with e1071package but when I try to tune my parameters I retrieve this error Error in do.call(method, c(list(train.x[train.ind[[sample]], ], y = train.y[train.ind[[sample]]]), : 'what' must be a character string or a function below are my command

Re: [R] how to ignore NA with NA or NULL

2012-06-06 Thread jeff6868
Thanks again for your help jeff. Sorry if I'm not very clear. It's programmingly speaking hard to explain, and even to explain in english as I'm French. But i'll try again. Well your proposition removes the error, but it's not the result I'm expecting. You've removed NULL data.frames, but I need

Re: [R] Piecewise Lasso Regression

2012-06-06 Thread Vito Muggeo (UniPa)
dear Lucas, If you are interested in selecting the number of breakpoints here a possible remedy: 1. Fit a segmented model with a large number of breakpoints via the arguments psi=NA and stop.if.error=FALSE in seg.control() (see the example below) 2. extract the model matrix relevant to the

Re: [R] Chi square value of anova(binomialglmnull, binomglmmod, test=Chisq)

2012-06-06 Thread Marc Schwartz
On Jun 6, 2012, at 9:36 AM, peter dalgaard wrote: On Jun 6, 2012, at 10:59 , lincoln wrote: David Winsemius wrote This is making me think you really have multiple observation on the same individuals (and that persons make transitions from one state to another as a result of the

Re: [R] Fourier descriptors created in a loop

2012-06-06 Thread David Winsemius
On Jun 6, 2012, at 5:13 AM, aledanda wrote: Hi David, Thank you for your reply. /Somehow I'm guessing that this will involve load an unnamed package. Yep: ?create.fourier.descriptor No documentation for ‘create.fourier.descriptor’ in specified packages and libraries: you could try

[R] ggplot2: legend for geom_rug() ..?

2012-06-06 Thread Brian Smith
Hi, I was trying to make another legend for the rug plot. Sample code: library(ggplo2) ids - paste('id_',1:3,sep='') before - sample(9) after - sample(1:10,9) dat - as.matrix(cbind(before,after)) rownames(dat) - rep(ids,3) position - c(rep(10,3),rep(13,3),rep(19,3)) mdat -

Re: [R] Fourier descriptors created in a loop

2012-06-06 Thread David Winsemius
On Jun 6, 2012, at 11:46 AM, David Winsemius wrote: On Jun 6, 2012, at 5:13 AM, aledanda wrote: Hi David, Thank you for your reply. /Somehow I'm guessing that this will involve load an unnamed package. Yep: ?create.fourier.descriptor No documentation for ‘create.fourier.descriptor’ in

[R] Source code for simple Forward step wise regression .

2012-06-06 Thread Shilpi Harpavat (PDF)
Hi , I want to implement a simple forward stepwise regression in java which fits a linear model with no term and then add terms one by one .What would be the best algorithm to use along with Criterion for what terms to keep /Drop and when to Stop. Any help appreciated. Thanks -- *The

[R] Main effects and interactions in mixed linear models

2012-06-06 Thread Ron Stone
Dear all, This question may be too basic quesition for this list, but if someone has time to answer I will be happy. I have tried to find out, but haven't found a consice answer. As an example I use Pinheiro, J. C. Bates, D. M. 2000. Mixed-effects models in S and S-PLUS. Springer, New York.

Re: [R] Fourier descriptors created in a loop

2012-06-06 Thread aledanda
Thanks for your email, in fact the problem was in the nested loop!! By removing it and adding at the end i = i + 1 I solved the problem, all the rest stays the same. Best -- View this message in context:

[R] R2BayesX (command bayesx) doesn't work

2012-06-06 Thread niandra
Hi all, I have a problem with the library R2BayesX, when i try to use the command bayesx i get this error: dyld: Library not loaded: /usr/local/lib/libreadline.5.2.dylib Referenced from: /Library/Frameworks/R.framework/Versions/2.15/Resources/library/BayesXsrc/libs/i386/BayesX Reason: image

Re: [R] ggplot incorrect legend

2012-06-06 Thread jcrosbie
Thank you for your help. I would expect FuelTypeNum to make up the legend. But in the legend there is an extra value of called '3' and in the chart there is an extra FuelTypeNum. code: ggplot(data=tempTable, aes(x=Bands8, y=AvailableMWNewFormat, fill=FuelTypeNum)) + geom_bar(position=stack,

[R] extracting values from txt file that follow user-supplied quote

2012-06-06 Thread emorway
useRs- I'm attempting to scan a more than 1Gb text file and read and store the values that follow a specific key-phrase that is repeated multiple time throughout the file. A snippet of the text file I'm trying to read is attached. The text file is a dumping ground for various aspects of the

Re: [R] How to calculate chi sqaure value from statistical value and degrees of freedom?

2012-06-06 Thread Rui Barradas
Hello, You are computing the lower tail value, for chi-squared tests it's probably the upper tail you want. p.val1 - 1 - pchisq(Stat, df) p.val2 - pchisq(Stat, df, lower.tail=FALSE) p.val1 == p.val2 Hope this helps, Rui Barradas Em 06-06-2012 02:31, Manish Gupta escreveu: Hi, My input is

Re: [R] Error in installing packages

2012-06-06 Thread Uwe Ligges
On 06.06.2012 17:14, Andreia Leite wrote: Dear list, I'm trying to install a package but every time I select the option form the menu this error message appears: utils:::menuInstallPkgs() Error in read.dcf(file = tmpf) : Line starting '!DOCTYPE html PUBLI ...' is malformed! Do you have

Re: [R] error calling Winbugs using R2WinBugs to run a multi-level model

2012-06-06 Thread Uwe Ligges
On 06.06.2012 16:51, ilai wrote: Untested because I don't have (use) winbugs and you didn't provide dat*. But consider a- 4 ; f- 6 list('a','f') list(a,f) list(a=a,f=f) My guess is you wanted sp.data to be a named list, not a list of names... That's also OK, from ?bugs.data: data: either

Re: [R] Main effects and interactions in mixed linear models

2012-06-06 Thread Bert Gunter
Ron: There are some misunderstandings in your message. See inline below. However, this is fundamentally not an R question -- it's about what to do not how to do it in R. So I suggest you post on a statistical list like stats.stackexchange.com. But as you have already noted, beware, you are

Re: [R] how to ignore NA with NA or NULL

2012-06-06 Thread Rui Barradas
Hello, Why don't you test an all(is.na(x)) condition? If TRUE, return(NA), not NULL. Rui Barradas Em 06-06-2012 16:42, jeff6868 escreveu: Thanks again for your help jeff. Sorry if I'm not very clear. It's programmingly speaking hard to explain, and even to explain in english as I'm French.

Re: [R] R2BayesX (command bayesx) doesn't work

2012-06-06 Thread Prof Brian Ripley
On 06/06/2012 16:13, niandra wrote: Hi all, I have a problem with the library R2BayesX, when i try to use the command bayesx i get this error: dyld: Library not loaded: /usr/local/lib/libreadline.5.2.dylib Referenced from:

Re: [R] extracting values from txt file that follow user-supplied quote

2012-06-06 Thread Bert Gunter
I think 1 gb is small enough that this can be easily and efficiently done in R. The key is: regular expressions are your friend. I shall assume that the text file has been read into R as a single character string, named mystring . The code below could easily be modifed to work on a a vector of

Re: [R] ggplot incorrect legend

2012-06-06 Thread John Kane
Try making FuelTypeNum into a factor like this: p - ggplot(data=tempTable, aes(x=Bands8, y=AvailableMWNewFormat, fill=as.factor(FuelTypeNum))) + geom_bar(position=stack, stat=identity)+ coord_flip() p John Kane Kingston ON Canada -Original Message- From:

Re: [R] ggplot2: legend for geom_rug() ..?

2012-06-06 Thread John Kane
What is X2? code not running at the moment John Kane Kingston ON Canada -Original Message- From: bsmith030...@gmail.com Sent: Wed, 6 Jun 2012 11:52:25 -0400 To: r-help@r-project.org Subject: [R] ggplot2: legend for geom_rug() ..? Hi, I was trying to make another legend for

Re: [R] Trouble with Functions

2012-06-06 Thread Peter Ehlers
On 2012-06-05 17:00, dougmcintosh wrote: FYI - here are the errors (I can get rid of the first one by removing the progress parameter - which I understand controls whether a progress bar is displayed). The second one stops at the gsub call. Maybe if someone could give me a properly formatted

Re: [R] How to label certain values on a curve?

2012-06-06 Thread Wendy Han
This is exactly what I need. Thanks a lot! Best, Wendy On Wed, Jun 6, 2012 at 11:38 AM, R. Michael Weylandt michael.weyla...@gmail.com wrote: Take a look at the identify() function. Best, Michael On Wed, Jun 6, 2012 at 11:23 AM, Wendy Han wendyha...@gmail.com wrote: Hi all, I have

[R] Sobel's test for mediation and lme4/nlme

2012-06-06 Thread G B
Hello, Any advice or pointers for implementing Sobel's test for mediation in 2-level model setting? For fitting the hierarchical models, I am using lme4 but could also revert to nlme since it is a relatively simple varying intercept model and they yield identical estimates. I apologize for this is

Re: [R] Main effects and interactions in mixed linear models

2012-06-06 Thread arun
Hi Ron, When the interaction is significant, I will not look at the significance of main effects as the main effect significance are irrelevant.  Then the comparisons could be made between the simple effect means. A.K.  - Original Message - From: Ron Stone ronstone1...@gmail.com

Re: [R] ARCH modelling/MA process

2012-06-06 Thread KelseyStroud
To specify what I want to do, I want to forecast the volatility of the series bases on the previous volatility. The prices are now daily returns, they are logged and differentiated. I have also looked at generating two dates, use calenderdate and one compdate for use in the model. In compdate,

Re: [R] Combine subsets by factor level

2012-06-06 Thread arun
Hi Iglucia, I am not sure how your dataset looks like.  Does it look similar to this: dat4-data.frame(patient=rep(c(1:10), rep(3,10)),var=rep(c(cycle0,cycle1,cycle2),rep(1,3)),value=c(rnorm(15,1,0.5),NA,rnorm(5,1,0.5),NA,rnorm(8,1,0.5))) dat4    patient    var value 1    1 cycle0

Re: [R] Do YOU know an equation for splines (ns)?

2012-06-06 Thread Ranae
I have not been able to get predict (or most functions) to run well with grouped data in nlme. I may not have it coded right, but this is what it looks like: http://r.789695.n4.nabble.com/file/n4632567/spline.txt spline.txt library(nlme) library(splines) rootCN-read.table(spline.txt,

Re: [R] Chi square value of anova(binomialglmnull, binomglmmod, test=Chisq)

2012-06-06 Thread lincoln
Thank you all, This was exactly the sort of help I hoped to get. -- View this message in context: http://r.789695.n4.nabble.com/Chi-square-value-of-anova-binomialglmnull-binomglmmod-test-Chisq-tp4632293p4632568.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] Combine subsets by factor level

2012-06-06 Thread Lib Gray
Yes, except that patients have different cycle numbers. Such as, one might have cycle 1,2,3, and another has 1,4,12. On Jun 6, 2012 12:54 PM, arun smartpink...@yahoo.com wrote: Hi Iglucia, I am not sure how your dataset looks like. Does it look similar to this:

Re: [R] Combine subsets by factor level

2012-06-06 Thread arun
Hi, Try this: library(reshape) dat4-data.frame(patient=rep(c(1:10), rep(3,10)),var=rep(c(cycle0,cycle1,cycle2),rep(1,3)),value=c(rnorm(15,1,0.5),NA,rnorm(5,1,0.5),NA,rnorm(8,1,0.5))) dat5-cast(dat4,patient~var,value=value) dat5    patient    cycle0    cycle1    cycle2 1    1 1.8826827

[R] Sobel's test for mediation and lme4/nlme

2012-06-06 Thread G B
Hello, Any advice or pointers for implementing Sobel's test for mediation in 2-level model setting? For fitting the hierarchical models, I am using lme4 but could also revert to nlme since it is a relatively simple varying intercept model and they yield identical estimates. I apologize for this is

Re: [R] Trouble with Functions

2012-06-06 Thread dougmcintosh
Haha no, TextWrangler. And that was definitely it...I think what was happening is that when I opened the text version of the book it opened in Notepad, which was probably opened the txt file in RTF. Then I copied and pasted the function code into TextWrangler and didn't even think about Smart

[R] Sobel's test for mediation and lme4/nlme

2012-06-06 Thread G B
Hello, Any advice or pointers for implementing Sobel's test for mediation in 2-level model setting? For fitting the hierarchical models, I am using lme4 but could also revert to nlme since it is a relatively simple varying intercept model and the two yield identical estimates. I apologize for this

[R] package zoo, function na.spline with option maxgap - Error: attempt to apply non-function?

2012-06-06 Thread May Katharina
Hello, I'm trying to use na.spline (package zoo) to fill some missing data in a time series. this works fine, however, if I apply the 'maxgap' argument, I always get the error: -- Error in na.spline.vec(x., coredata(object.), xout = xout., ...) : attempt to apply non-function -- I

Re: [R] package zoo, function na.spline with option maxgap - Error: attempt to apply non-function?

2012-06-06 Thread R. Michael Weylandt
Thanks for the great reproducible example -- I can confirm on the devel version of zoo. I'd venture it's a buglet in that maxgap gets passed (by way of dots) to na.spline -- na.spline.zoo -- na.spline.default -- na.spline.vec -- to both .fill_short_gaps (good) and spline (bad) which is where the

[R] heatmap.2 clustering and adding add.expr

2012-06-06 Thread Tanu Soni
Hi , I am trying to plot a heatmap with a correlation matrix and trying to highlight significant correlations . i am using my matrix d874n has 78 columns ex2-corAndPvalue(data.matrix(d874n),use = pairwise.complete.obs) ##creating a matrix of true false using p values sig-ex2$p0.05 nx=78 ny=78

Re: [R] package zoo, function na.spline with option maxgap - Error: attempt to apply non-function?

2012-06-06 Thread Gabor Grothendieck
On Wed, Jun 6, 2012 at 3:55 PM, May Katharina may.kathar...@googlemail.com wrote: Hello, I'm trying to use na.spline (package zoo) to fill some missing data in a time series. this works fine, however, if I apply the 'maxgap' argument, I always get the error: -- Error in

Re: [R] Do YOU know an equation for splines (ns)?

2012-06-06 Thread Bert Gunter
Ah ... Iirc believe the problem is that you need to explicitly generate the spline basis and then the predicted values via predict.ns and feed that to predict.lme; i.e. splineBas - with(rcn10,ns(day,3)) newvals - data.frame( predict(splineBas, num)) ## then once you've fitted your model:

Re: [R] package zoo, function na.spline with option maxgap - Error: attempt to apply non-function?

2012-06-06 Thread May Katharina
On Jun 6, 2012, at 10:19 , Gabor Grothendieck wrote: On Wed, Jun 6, 2012 at 3:55 PM, May Katharina may.kathar...@googlemail.com wrote: Hello, I'm trying to use na.spline (package zoo) to fill some missing data in a time series. this works fine, however, if I apply the 'maxgap' argument,

[R] Process XML files

2012-06-06 Thread Santosh
Hello experts, Sorry for posting the SPlus related question here.. I have not found any solution yet after some attempts and hence, sending it to a wider spectrum of users! I was successful in processing files uing R's XML librariy. Thank you, Rxperts! I know there are libraries like XML and

Re: [R] Do YOU know an equation for splines (ns)?

2012-06-06 Thread William Dunlap
Do you have to include the grouping variable, plotF, in your newdata argument? E.g., after fitting the model with rcn10G-groupedData(N ~ day | plotF, data=rcn10) fit10 - lme( N~ns(day, 3), data = rcn10G) try checking the predictions when you've include plotF in newdata: par(mfrow=c(2,1))

[R] Removing Double Quotations After Using Cbind

2012-06-06 Thread Joshua Budman
Hi, I am trying to process genomics data and the presence of both characters and integers in an array is giving issues. The following is an example: a-array(c(2,2,X,1:3,2:4),dim=c(3,3)) b-cbind(a[,1],a[,2]) With the output being: [,1] [,2] [1,] 2 1 [2,] 2 2 [3,] X 3 Is there any

Re: [R] Error in installing packages

2012-06-06 Thread Andreia Leite
Yes it's windows (vista). It's not a specific package. I've tried more than a CRAN mirror and the message it's always date (the list with the packages simply doesn't appear). What proxy settings should I verify specifically (sorry I don't know a lot on informatics)? I've installed a few packages

[R] how to remove part of the string

2012-06-06 Thread Bill Hyman
Dear all, Does any one know how to remove part of the string? For example, LTA4H||Leukotriene A4 hydrolase is a gene name plus gene description. I hope to remove ||Leukotriene A4 hydrolase. What would be the R code to do that using gsub()? Many thanks! Bill

Re: [R] Combine subsets by factor level

2012-06-06 Thread Lib Gray
They do not; each patient only has rows for the cycles it has. Some have only one, some have more than ten. On Jun 6, 2012 2:24 PM, arun smartpink...@yahoo.com wrote: Hi, Try this: library(reshape) dat4-data.frame(patient=rep(c(1:10),

Re: [R] Removing Double Quotations After Using Cbind

2012-06-06 Thread andrija djurovic
Hi. Try: as.data.frame(cbind(a[,1],a[,2])) Andrija On Wed, Jun 6, 2012 at 9:51 PM, Joshua Budman josh.bud...@gmail.com wrote: Hi, I am trying to process genomics data and the presence of both characters and integers in an array is giving issues. The following is an example:

Re: [R] how to remove part of the string

2012-06-06 Thread andrija djurovic
Hi. You can do something like this: gsub(\\|\\|Leukotriene A4 hydrolase,,LTA4H||Leukotriene A4 hydrolase) Andrija On Wed, Jun 6, 2012 at 10:45 PM, Bill Hyman billhym...@yahoo.com wrote: Dear all, Does any one know how to remove part of the string? For example, LTA4H||Leukotriene A4

Re: [R] How to label certain values on a curve?

2012-06-06 Thread Ted Harding
On the subject of identify() [perhaps I should change thread]: '?identify' clearly states: Value: If 'pos' is 'FALSE', an integer vector containing the indices of the identified points, in the order they were identified. However, I find that the result is not in the order of

Re: [R] how to remove part of the string

2012-06-06 Thread Rui Barradas
Hello, Try txt - LTA4H||Leukotriene A4 hydrolase pattern - \\|\\|.*$ gsub(pattern, , txt) Hope this helps, Rui Barradas Em 06-06-2012 21:45, Bill Hyman escreveu: Dear all, Does any one know how to remove part of the string? For example, LTA4H||Leukotriene A4 hydrolase is a gene name

Re: [R] how to remove part of the string

2012-06-06 Thread andrija djurovic
Hi. Rui already gave you a solution. Beside that you can, also, use substr function in this concrete example: substr(LTA4H||Leukotriene A4 hydrolase, 1, 5) This can be adjusted to rest of your data also, but you haven't provided enough information. Andrija On Wed, Jun 6, 2012 at 11:27 PM, Rui

[R] Proxy Setting

2012-06-06 Thread Gurubaramurugeshan, Arun
Hi, I am trying to download data off of this web site http://www.eia.gov/oil_gas/petroleum/data_publications/wrgp/mogas_history.html I used to set the proxy following code to set the proxy Sys.setenv(wget=http://username:password@proxy server:port) I used the following code to download the data

Re: [R] Error in installing packages

2012-06-06 Thread Martin Morgan
On 06/06/2012 01:41 PM, Andreia Leite wrote: Yes it's windows (vista). It's not a specific package. I've tried more than a CRAN mirror and the message it's always date (the list with the packages simply doesn't appear). What proxy settings should I verify specifically (sorry I don't know a lot

Re: [R] package zoo, function na.spline with option maxgap - Error: attempt to apply non-function?

2012-06-06 Thread Gabor Grothendieck
On Wed, Jun 6, 2012 at 4:40 PM, May Katharina may.kathar...@googlemail.com wrote: On Jun 6, 2012, at 10:19 , Gabor Grothendieck wrote: On Wed, Jun 6, 2012 at 3:55 PM, May Katharina may.kathar...@googlemail.com wrote: Hello, I'm trying to use na.spline (package zoo) to fill some missing data

Re: [R] Removing Double Quotations After Using Cbind

2012-06-06 Thread David Winsemius
On Jun 6, 2012, at 3:51 PM, Joshua Budman wrote: Hi, I am trying to process genomics data and the presence of both characters and integers in an array is giving issues. That is probably because you do not understand that it there is even one character in an array, then that is what ALL the

Re: [R] Do YOU know an equation for splines (ns)?

2012-06-06 Thread Spencer Graves
I agree with Bill and Bert: predict is the proper tool for making predictions. Pinheiro and Bates (2000) Mixed-Effects Models in S and S-Plus (Springer) includes several entries in the index for predictions. Please note, however, that there are a few lines of code in that book the

[R] non ascill characters in plots. no alternative but plotmath?

2012-06-06 Thread Paul Johnson
A student entered some data with text characters like epsilon and alpha. On her Windows system, the Greek letters did not display properly in a plot. There were some ordinary ASCII instead. I asked her to send me the code so I could test. For me, the plot looks ok on the screen. Format1 -

Re: [R] Removing Double Quotations After Using Cbind

2012-06-06 Thread Jeff Newmiller
Arrays must all be the same type. Data frame columns may be of differing types. Try to avoid creating a matrix and converting it to a data frame. a- data.frame(name=c(2,2,X), value=c(,1:3,2:4), as.is=TRUE) str(a) --- Jeff

Re: [R] regression methods for rare events?

2012-06-06 Thread Duncan Mackay
Hi Xavier Try VGAM package see Extremes (2007) 10:1–19 DOI 10.1007/s10687-007-0032-4 Vector generalized linear and additive extreme value models Thomas W. Yee Alec G. Stephenson It just happens that I had the pdf open Regards Duncan Duncan Mackay Department of Agronomy and Soil Science

  1   2   >