Re: [R] how to add a variable to a graph title

2012-07-13 Thread Michael Weylandt
plot(1:5, main = paste0(Figure 1: x=, x)) Michael On Jul 12, 2012, at 3:30 PM, JeffND zuofeng.shan...@nd.edu wrote: Hi folks, To simplify my question, consider an example: x=runif(1,0,1) plot(1:5,1:5) Now I want to add a title to the above plot showing the vaue of x, so if the

[R] Side by side strip charts

2012-07-13 Thread darnold
Hi, I'm looking for some ideas on how to reproduce the attached image in R. There are three samples, each of size n = 10. The first is drawn from a normal distribution with mean 60 and standard deviation 3. The second is drawn from a normal distribution with mean 65 and standard deviation 3. The

Re: [R] Side by side strip charts

2012-07-13 Thread Gerrit Eichner
Hi, Arnold, looking at the example section of ?stripchart may help you. Hth -- Gerrit On Thu, 12 Jul 2012, darnold wrote: Hi, I'm looking for some ideas on how to reproduce the attached image in R. There are three samples, each of size n = 10. The first is drawn from a normal

[R] tck = 0 for the colorkey?

2012-07-13 Thread Martin Ivanov
Dear R users, I am struggling with the colorkey on a levelplot lattice graphic. I want that no ticks are printed on the colorkey. That is, I want their size tck=0. Merely setting tck=0 t in the colorkey parameter does not work. Setting it in the lattice.par.set() removes the ticks from the

Re: [R] Side by side strip charts

2012-07-13 Thread peter dalgaard
On Jul 13, 2012, at 08:18 , darnold wrote: Hi, I'm looking for some ideas on how to reproduce the attached image in R. There are three samples, each of size n = 10. The first is drawn from a normal distribution with mean 60 and standard deviation 3. The second is drawn from a normal

Re: [R] trellis margin sizes in absolute units

2012-07-13 Thread Deepayan Sarkar
On Thu, Jul 12, 2012 at 9:39 PM, Martin Ivanov tra...@abv.bg wrote: Dear R users, I have a lot of experience with traditional R graphics, but I decided to turn to trellis as it was recommended for spatial graphs by the sp package. In traditional R graphics I always first set the size of

Re: [R] SVAR Restriction on AB-model

2012-07-13 Thread Pfaff, Bernhard Dr.
Hello Veronica, what makes you think that this is an error? It is a warning that your specified SVAR-model is **just** identified and hence an over-identification test cannot be conducted. You can suppress this warning by not asking for an over-identification in the first place, by setting

Re: [R] remove loop which compares row i to row i-1

2012-07-13 Thread Rui Barradas
Hello, Works unchanged with me. Yesterday it could have worked for some other reason, like having other variables in my environment, which I had, but this time I have started anew. Try including tUnitsmall - tUnitsort[, cols] and then use this data.frame to see what happens. Rui Barradas

Re: [R] Adjusting format of boxplot

2012-07-13 Thread Ivan Calandra
Hi Peter, I had never heard of this 'frame' argument and it's a breakthrough for me to be finally able to get rid of this frame! But where is this argument explained? I couldn't find it in plot(), boxplot(), bxp() or par(). Thank you for your answer :) Ivan -- Ivan CALANDRA Université de

[R] minor axis ticks in trellis graphics?

2012-07-13 Thread Martin Ivanov
Dear R users, I need to add minor axis ticks to my graph. In traditional R this is easily achievable by simply adding a second axis with the minor ticks. But how to do that in trellis? I am already out of ideas. Any suggestions will be appreciated. Best regards, Martin

Re: [R] Adjusting format of boxplot

2012-07-13 Thread Gerrit Eichner
Hello, Ivan, you'll find argument frame (actually frame.plot) explained in ?plot.default Regards -- Gerrit Hi Peter, I had never heard of this 'frame' argument and it's a breakthrough for me to be finally able to get rid of this frame! But where is this argument explained? I couldn't

Re: [R] how to add a variable to a graph title

2012-07-13 Thread mlell08
To use variables in mathematical expressions, bquote can be used: #Term in in .( ) is evaluated plot(1:10,main=bquote(frac(alpha,.(2+2 -- GnuPG Key: 0x7340821E __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help

Re: [R] Substitute list value

2012-07-13 Thread Jessica Streicher
two things: - R always counts from 1, not from 0 - listmembers are accessed by using [[ ]] , not [ ] try t1[t==ll[[1]], v] - 99 greetings Jessi On 11.07.2012, at 15:47, Charles Stangor wrote: I can't seem to determine how to get the name of a list member to substitute: ll - list(a1 =

Re: [R] How to find frequent sequences.

2012-07-13 Thread Petr Savicky
On Thu, Jul 12, 2012 at 03:51:54PM -0500, Vineet Shukla wrote: I have independent event sequences for example as follows : Independent event sequence 1 : A , B , C , D Independent event sequence 2 : A, C , B Independent event sequence 3 :D, A, B, X,Y, Z Independent event sequence 4

Re: [R] Package 'MASS' (polr): Error in svd(X) : infinite or missing values in 'x'

2012-07-13 Thread Jessica Streicher
You could probably make them numeric, like v-c(a,a,b,c) f-factor(v) as.numeric(f) [1] 1 1 2 3 to get a numeric rock_id, but i wouldn't per se recommend it. You should ask someone who knows more about the scientific side of this method to tell you how factorial data is properly treated.

Re: [R] tck = 0 for the colorkey?

2012-07-13 Thread Deepayan Sarkar
On Fri, Jul 13, 2012 at 12:21 PM, Martin Ivanov tra...@abv.bg wrote: Dear R users, I am struggling with the colorkey on a levelplot lattice graphic. I want that no ticks are printed on the colorkey. That is, I want their size tck=0. Merely setting tck=0 t in the colorkey parameter does not

Re: [R] how to add a variable to a graph title

2012-07-13 Thread JeffND
Thank you for this useful code! -- View this message in context: http://r.789695.n4.nabble.com/how-to-add-a-variable-to-a-graph-title-tp4636364p4636405.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list

Re: [R] plot graph by first letter

2012-07-13 Thread arun
Hello, This information is new.  Are you able to import data from access? A.K. - Original Message - From: imnew jubil...@live.com.sg To: r-help@r-project.org Cc: Sent: Thursday, July 12, 2012 9:52 PM Subject: Re: [R] plot graph by first letter Hi, for my dataset is actually

Re: [R] Two R sessions on multicore computer seem to inhibit each other ?

2012-07-13 Thread Ulrike Grömping
Thanks to both of you, you are probably right that memory is the limiting factor. I have no knowledge about the available memory on the lab machines, but I will find out and make sure that this is the explanation. Best, Ulrike -- View this message in context:

[R] Help with R2 OpenBUGs

2012-07-13 Thread SuzieK
Hi, I'm currently working on the below codes however whenever I run it in openbugs it gives an error message saying: unknown type of logical function error pos 76. Any help would be appreciated. ## bugs code library(R2OpenBUGS) sink(C:/Users/CCF/Documents/Suzie Work/PTY Project/Waterhole

[R] Column create and Update using function

2012-07-13 Thread Rantony
Hi, here i have a Max and Min values Min -3 Max -6 and also a matrix like this, ABCXYZ PQR -- ------ 2 43 5 48 7 13 In this i need to check each particular

[R] Merging on Datetime Column

2012-07-13 Thread vioravis
I have the following dataframe with the first column being of type datetime: dateTime - c(10/01/2005 0:00, 10/01/2005 0:20, 10/01/2005 0:40, 10/01/2005 1:00, 10/01/2005 1:20) var1 - c(1,2,3,4,5) var2 - c(10,20,30,40,50) df -

Re: [R] many don't know responses

2012-07-13 Thread Iasonas Lamprianou
Dear all, I am analyzing data from a survey question where I have many Don'k know responses. Respondents could either say Don't know or give a rating from 0 to 10. I could analyse the Don't know responses separately using a logistic regression to see who is the typical person who doesnt know

[R] Loading R scripts stored behind htaccess

2012-07-13 Thread Gaj Stan (BIGCAT)
Hello, Within my department I would like to share the latest version(s) of my R scripts to my colleagues using subversion. This repository is password protected (WebDAV) as it should not be accessed by external persons. In the majority of my scripts I load scripts using the source() function,

Re: [R] Substitute list value

2012-07-13 Thread Charles Stangor
thanks! On Fri, Jul 13, 2012 at 4:35 AM, Jessica Streicher j.streic...@micromata.de wrote: two things: - R always counts from 1, not from 0 - listmembers are accessed by using [[ ]] , not [ ] try t1[t==ll[[1]], v] - 99 greetings Jessi On 11.07.2012, at 15:47, Charles Stangor wrote:

Re: [R] Merging on Datetime Column

2012-07-13 Thread Rui Barradas
Hello, Check the structure of what you have, df and newdf. You will see that in df dateTime is of class POSIXlt and in newDf newDateTime is of class POSIXct. Solution: [...] df$dateTime - strptime(df$dateTime,%m/%d/%Y %H:%M) df$dateTime - as.POSIXct(df$dateTime) [...] Hope this helps, Rui

Re: [R] Warning message with read.csv.sql

2012-07-13 Thread Gabor Grothendieck
On Thu, Jul 12, 2012 at 8:17 AM, Bharat Warule bwar...@gmail.com wrote: Hello, I am using read.csv.sql first time for reading the large data file.If I am ran this code that showns warning “closing unused connection”. Is it I am missing any argument from my command or how to comeout from this

Re: [R] Vuong test

2012-07-13 Thread Marc Schwartz
On Jul 13, 2012, at 12:35 AM, sanchez ana wrote: Dear All, I am using the function vuong from pscl package to compare 2 non nested models NB1 (negative binomial I ) and Zero-inflated model. NB1 - glm(, , family = quasipoisson), it is an object of class: glm lm zinb - zeroinfl(

Re: [R] -1.1 - 0.1 + 1.2 is NOT null! Why?

2012-07-13 Thread ollestrat
Thank you for the explanation. Good to know about the issue how double values are constructed by a bit system. This makes me handling double values with care in using it in R or aother languages control structures etc. Thank you also for the hint concerning the Null vs. Zero vs.. issue. Yes, the

Re: [R] -1.1 - 0.1 + 1.2 is NOT null! Why?

2012-07-13 Thread ollestrat
Someone pointed me to this paper: http://www.validlab.com/goldberg/paper.pdf -- View this message in context: http://r.789695.n4.nabble.com/1-1-0-1-1-2-is-NOT-null-Why-tp4636053p4636433.html Sent from the R help mailing list archive at Nabble.com. __

Re: [R] image.plot transparent?

2012-07-13 Thread Chris82
Hello, hiere is a small reproducible example. All z.i which are NA should be transparent at the plot, but they are white colored. ### Example image.plot regular x,y grid ### x - seq(2,2.9,0.1) y - seq(42,42.9,0.1) z - matrix(seq(-5,4.9,0.1),nrow=10) image.plot(x,y,z) ### overplotting by

[R] How to Generate index File From Rd file

2012-07-13 Thread purushothaman
Hi, I need to generate HTML index file from Rd file. example Module Class Function Description Csvfunction csvoperations Module Description http://test Read CSV Function

Re: [R] Substitute list value

2012-07-13 Thread Bert Gunter
Jessica: On Fri, Jul 13, 2012 at 1:35 AM, Jessica Streicher j.streic...@micromata.de wrote: two things: - R always counts from 1, not from 0 - listmembers are accessed by using [[ ]] , not [ ] FALSE! -- or at least not clearly stated: x - list(a=letters[1:3],b=1:4) x[[2]] [1] 1 2 3 4

Re: [R] read.table with numeric row names

2012-07-13 Thread peter dalgaard
On Jul 13, 2012, at 04:27 , arun wrote: Hello, I saw your reply in nabble. Sorry about that. I thought the dataset had only few columns. #You can read first line of a file using: readLines(foo.txt,n=1)[1] #The more generic colname substitution dat1-read.table(text= 2.5 3.6

Re: [R] Substitute list value

2012-07-13 Thread Duncan Murdoch
On 13/07/2012 9:50 AM, Bert Gunter wrote: Jessica: On Fri, Jul 13, 2012 at 1:35 AM, Jessica Streicher j.streic...@micromata.de wrote: two things: - R always counts from 1, not from 0 - listmembers are accessed by using [[ ]] , not [ ] FALSE! -- or at least not clearly stated: x -

[R] Power analysis for Cox regression with a time-varying covariate

2012-07-13 Thread Paul Miller
Hello All, Does anyone know where I can find information about how to do a power analysis for Cox regression with a time-varying covariate using R or some other readily available software? I've done some searching online but haven't found anything. Thanks, Paul

Re: [R] read.table with numeric row names

2012-07-13 Thread jim holtman
Try this: x - read.table(text = 2.5 3.6 7.1 7.9 + 100 3 4 2 3 + 200 3.1 4 3 3 + 300 2.2 3.3 2 4, header = TRUE, check.names = FALSE) x 2.5 3.6 7.1 7.9 100 3.0 4.0 2 3 200 3.1 4.0 3 3 300 2.2 3.3 2 4 names(x) [1] 2.5 3.6 7.1

Re: [R] read.table with numeric row names

2012-07-13 Thread William Dunlap
BTW, is there an R command to read just the first line of the file? scan() or readLines() will read as many lines of the file as you want. Use the file() function to open a file connection so a subsequent read.table() will start where scan() or readLines() finished. E.g., tfile - tempfile()

Re: [R] easy way to fit saturated model in sem package?

2012-07-13 Thread Joshua Wiley
Dear John, Thanks very much for the reply. Looking at the optimizers, I had thought that the objectiveML did what I wanted. I appreciate the clarification. I think that multiple imputation is more flexible in some ways because you can easy create different models for every variable. At the

[R] which() in subset()

2012-07-13 Thread Charles Stangor
Why does the subset not work in the which() version below? Thank you v1 - subset(t1, version_1==as.character(100-1) | version_1==as.character(100-2)) a-c(100-1, 100-2) v1 - subset(t1, which(a==as.character(version_1)) != 0) [[alternative HTML version deleted]]

[R] prediction interval for predicted y mean at terminal node - rpart method anova

2012-07-13 Thread agent dunham
Dear community, I'm using rpart and would like to extract 95% prediction interval at each terminal node from a regression tree (built with rpart, method= anova) Is that possible? Thanks in advance, u...@host.com as crossp...@host.com -- View this message in context:

Re: [R] Help with R2 OpenBUGs

2012-07-13 Thread Tom Porteus
It seems to not be recognising a function you are calling within your model - taking a quick look you might want to check that table() is a function in OpenBUGS. g - length(table(G)) TP -- View this message in context: http://r.789695.n4.nabble.com/Help-with-R2-OpenBUGs-tp4636412p4636424.html

[R] box plot and plot whiskers

2012-07-13 Thread Barbara Uszczynska
Dear R users, I have question concerning box plot and it's whiskers. As I understood from the description of the boxplot() function, if the range value is positive the plot whiskers extend out from the box to the most extreme data points defined by the values of the IQR times range (default

Re: [R] Grabbing Indexes of a certain standard deviation

2012-07-13 Thread gcm
Thank you a ton! This is perfect! From: Jean V Adams [via R] [mailto:ml-node+s789695n4636370...@n4.nabble.com] Sent: Thursday, July 12, 2012 4:59 PM To: Lauren Vogric Subject: Re: Grabbing Indexes of a certain standard deviation I wrote a little function called first() to help with situations

Re: [R] Maximum number of patterns and speed in grep

2012-07-13 Thread mdvaan
Thanks, I see that it is working in the sample data. My data, however, gives me an error message: data - strapplyc(text, batch[[l]]) Error in structure(.External(dotTcl, ..., PACKAGE = tcltk), class = tclObj) : [tcl] couldn't compile regular expression pattern: parentheses () not balanced.

Re: [R] read.table with numeric row names

2012-07-13 Thread kexinz
Thanks all you guys' help! -- View this message in context: http://r.789695.n4.nabble.com/read-table-with-numeric-row-names-tp4636342p4636446.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list

[R] Running R from the command line: weird problem

2012-07-13 Thread Abhi Raghavan
Hi, I'm trying to run an R script from the command line and I do it in the following way: R CMD BATCH -q something.R output file* *I write the R script from inside a Perl program (on UNIX of course!) and execute the shell command using the function system.**What intrigues me is the strange

Re: [R] easy way to fit saturated model in sem package?

2012-07-13 Thread luke-tierney
They look fine to me. luke On Fri, 13 Jul 2012, Joshua Wiley wrote: Dear John, Thanks very much for the reply. Looking at the optimizers, I had thought that the objectiveML did what I wanted. I appreciate the clarification. I think that multiple imputation is more flexible in some ways

Re: [R] easy way to fit saturated model in sem package?

2012-07-13 Thread luke-tierney
Apologies -- replied to the wrong message. luke On Fri, 13 Jul 2012, luke-tier...@uiowa.edu wrote: They look fine to me. luke On Fri, 13 Jul 2012, Joshua Wiley wrote: Dear John, Thanks very much for the reply. Looking at the optimizers, I had thought that the objectiveML did what I

Re: [R] box plot and plot whiskers

2012-07-13 Thread David L Carlson
The whiskers will not be symmetrical if 1.5*IQR extends beyond the maximum or minimum values. In that case, the whisker stops at the maximum or minimum. - David L Carlson Associate Professor of Anthropology Texas AM University College Station, TX 77840-4352

Re: [R] Maximum number of patterns and speed in grep

2012-07-13 Thread Gabor Grothendieck
On Fri, Jul 13, 2012 at 9:40 AM, mdvaan mathijsdev...@gmail.com wrote: Thanks, I see that it is working in the sample data. My data, however, gives me an error message: data - strapplyc(text, batch[[l]]) Error in structure(.External(dotTcl, ..., PACKAGE = tcltk), class = tclObj) : [tcl]

[R] significance test interquartile ranges

2012-07-13 Thread Schaber , Jörg
Hi, I have two non-normal distributions and use interquartile ranges as a dispersion measure. Now I am looking for a test, which tests whether the interquartile ranges from the two distributions are significantly different. Any idea? Thanks, joerg [[alternative HTML version deleted]]

[R] R-squared with Intercept set to 0 (zero) for linear regression in R is incorrect

2012-07-13 Thread Pamela Krone-Davis
Hi, I have been using lm in R to do a linear regression and find the slope coefficients and value for R-squared. The R-squared value reported by R (R^2 = 0.9558) is very different than the R-squared value when I use the same equation in Exce (R^2 = 0.328). I manually computed R-squared and the

Re: [R] which() in subset()

2012-07-13 Thread Rui Barradas
Hello, To know why, just evaluate the condition, with 't1$' before 'version_1': which(as.character(t1$version_1) %in% a) != 0 [1] TRUE TRUE It allways evaluates to TRUE, therefore, subset() returns all rows. See if this isn't simpler than both of your forms. v2 - subset(t1, version_1 %in%

Re: [R] Adjusting format of boxplot

2012-07-13 Thread Bert Gunter
?plot.default ## documents the frame.plot arg and ?boxplot ## documents miscellaneous graphical parameters that go into ... I would agree that the documentation is relatively poor, a legacy of the original graphics system, which splits up parameter documentation among par(), plot(), and specific

Re: [R] box plot and plot whiskers

2012-07-13 Thread S Ellison
-Original Message- I have question concerning box plot and it's whiskers. As I understood from the description of the boxplot() function, if the range value is positive the plot whiskers extend out from the box to the most extreme data points defined by the values of the IQR

Re: [R] which() in subset()

2012-07-13 Thread Charles Stangor
Thanks Dennis and Mike... I'm getting it!!! Sent from my Android Rui Barradas ruipbarra...@sapo.pt wrote: Hello, To know why, just evaluate the condition, with 't1$' before 'version_1': which(as.character(t1$version_1) %in% a) != 0 [1] TRUE TRUE It allways evaluates to TRUE, therefore,

Re: [R] Help with R2 OpenBUGs

2012-07-13 Thread Uwe Ligges
On 13.07.2012 12:51, Tom Porteus wrote: It seems to not be recognising a function you are calling within your model - taking a quick look you might want to check that table() is a function in OpenBUGS. g - length(table(G)) Additional hint: For debugging purposes, it is advisable to open

Re: [R] Help with R2 OpenBUGs

2012-07-13 Thread Uwe Ligges
On 13.07.2012 12:51, Tom Porteus wrote: It seems to not be recognising a function you are calling within your model - taking a quick look you might want to check that table() is a function in OpenBUGS. g - length(table(G)) [This time also CCing the OP] Additional hint: For debugging

Re: [R] R2OpenBUGS quesion

2012-07-13 Thread Uwe Ligges
On 13.07.2012 03:18, elong zhang wrote: Dear All: Could anybody help me figure out why I get the Error message below while I running the example code of bugs() function in R2OpenBUGS packages? I have tried the code both in Win 7 and Ubuntu 12.04, but they show the same message. My R version

Re: [R] How to get all list item to one string variable

2012-07-13 Thread MacQueen, Don
First of all, although the question uses the term list, the object named 'a' is clearly not a list as R defines the term. It is a vector. Thus a better example answer is a - c('abc', 'def') paste(a , collapse=' ') and this works for however many elements there are in the vector a. The

Re: [R] Side by side strip charts

2012-07-13 Thread darnold
OK, got this far: x1 - round(rnorm(10,60,3)) x2 - round(rnorm(10,65,3)) x3 - round(rnorm(10,70,3)) stripchart(list(sample1=x1,sample2=x2,sample3=x3), method=stack, pch=4, offset=1/2, col=blue, lwd=2, las=1) Any ideas on how to get

Re: [R] Running R from the command line: weird problem

2012-07-13 Thread Duncan Murdoch
On 13/07/2012 9:46 AM, Abhi Raghavan wrote: Hi, I'm trying to run an R script from the command line and I do it in the following way: R CMD BATCH -q something.R output file* *I write the R script from inside a Perl program (on UNIX of course!) and execute the shell command using the function

Re: [R] R-squared with Intercept set to 0 (zero) for linear regression in R is incorrect

2012-07-13 Thread William Dunlap
What does Excel give for the following data, where the by-hand formula you gave is obviously wrong? x - c(1, 2, 3) y - c(13.1, 11.9, 11.0) M1 - lm(y~x+0) sqerr - (y- predict(M1)) ^ 2 sqtot - (y - mean(y)) ^ 2 1 - sum(sqerr)/sum(sqtot) [1] -37.38707 Bill Dunlap Spotfire,

Re: [R] R-squared with Intercept set to 0 (zero) for linear regression in R is incorrect

2012-07-13 Thread William Dunlap
You might want to look at http://support.microsoft.com/kb/214230 entitled Incorrect output is returned when you use the Linear Regression (LINEST) function in Excel Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com -Original Message- From: r-help-boun...@r-project.org

[R] LOCFIT

2012-07-13 Thread Ioanna Ioannou
Hello, I am using the locfit to fit a non parametric glm model to data with a gamma distributed response variable. In the parametric glm regression the diagnostics were based on the study of the standardized deviance or pearson residuals. How can I estimate the the standardized Pearson

Re: [R] R-squared with Intercept set to 0 (zero) for linear regression in R is incorrect

2012-07-13 Thread John Sorkin
Pamela R squared with a non-zero, and with a zero intercept can be very different as the regression line that you get with and without a zero intercept can be very different. Have you plotted your data plot(k[,2],k[,1]) to see if a zero intercept is reasonable for your data? Have you drawn the

Re: [R] R-squared with Intercept set to 0 (zero) for linear regression in R is incorrect

2012-07-13 Thread William Dunlap
While excluding the intercept may make sense, your formula for r^2 assumes that there was an intercept (that is why mean(y) is in your expression for sqtot). Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com From: Pamela Krone-Davis [mailto:pkrone-da...@csumb.edu] Sent: Friday, July 13,

Re: [R] read.table with numeric row names

2012-07-13 Thread peter dalgaard
On Jul 13, 2012, at 17:59 , arun wrote: Hi Peter, I copied the data from your email and run it again. dat1-read.table(text= 2.5 3.6 7.1 7.9 100 3 4 23 200 3.1 4 3 3 300 2.2 3.3 24 ,sep=,header=TRUE) dat1 X2.5 X3.6 X7.1 X7.9 100

Re: [R] Side by side strip charts

2012-07-13 Thread John Kane
try something like abline(h=1.9) John Kane Kingston ON Canada -Original Message- From: dwarnol...@suddenlink.net Sent: Fri, 13 Jul 2012 09:54:35 -0700 (PDT) To: r-help@r-project.org Subject: Re: [R] Side by side strip charts OK, got this far: x1 - round(rnorm(10,60,3)) x2 -

Re: [R] Side by side strip charts

2012-07-13 Thread peter dalgaard
On Jul 13, 2012, at 18:54 , darnold wrote: OK, got this far: x1 - round(rnorm(10,60,3)) x2 - round(rnorm(10,65,3)) x3 - round(rnorm(10,70,3)) stripchart(list(sample1=x1,sample2=x2,sample3=x3), method=stack, pch=4, offset=1/2, col=blue,

[R] Fitting data and removing outliers

2012-07-13 Thread Lauren Vogric
What I'm trying to do is create best fit line in R for a set of data points and then remove all the outliers to re-create a best fit. I can't use IQR because the outliers I have in mind are easily within the range, but way out of line for the best fit, which is ruining the fit. I'd rather

Re: [R] Side by side strip charts

2012-07-13 Thread Rui Barradas
Hello, Or maybe the argument 'pos' of axis(). stripchart(list(sample1=x1,sample2=x2,sample3=x3), method=stack, pch=4, offset=1/2, col=blue, lwd=2, las=1, xlim=c(53, 77), xaxt=n) axis(1, at = seq(55, 75,

Re: [R] Fitting data and removing outliers

2012-07-13 Thread David L Carlson
I didn't actually see any question in this posting, but instead of removing the outliers consider using a robust linear model. library(MASS) ?rlm The TeachingDemos package has a data set called outliers to show what can happen when you iteratively remove outliers in the way you suggest.

Re: [R] Fitting data and removing outliers

2012-07-13 Thread stephen sefick
Do you have a good reason to throw these points out? On Fri, Jul 13, 2012 at 2:17 PM, David L Carlson dcarl...@tamu.edu wrote: I didn't actually see any question in this posting, but instead of removing the outliers consider using a robust linear model. library(MASS) ?rlm The

Re: [R] How to find frequent sequences.

2012-07-13 Thread Vineet Shukla
Hi Petr, Yes, that's really very helpful. Petr : Using this interpretation, AB occurs at lines 1,3,4 and not 1,3,5. Is this correct? Vineet : Yes , thats right sorry for the typo. Petr: If some sequence contains several ocurrences of a pattern, for example, the sequence A, B, A, B

[R] LiblineaR: read/write model files?

2012-07-13 Thread Sam Steingold
How do I read/write liblinear models to files? E.g., if I train a model using the command line interface, I might want to load it into R to look the histogram of the weights. Or I might want to train a model in R and then apply it using a command line interface. -- Sam Steingold

Re: [R] R-squared with Intercept set to 0 (zero) for linear regression in R is incorrect

2012-07-13 Thread William Dunlap
S+ and, I assume, R compute r^2 when there is no intercept as sum(fitted(M1)^2) / sum(y^2) where M1 is the fitted model and y the response. See, for example, http://web.ist.utl.pt/~ist11038/compute/errtheory/,regression/regrthroughorigin.pdf for the derivation of this formula. Bill Dunlap

Re: [R] Fitting data and removing outliers

2012-07-13 Thread Stephen Sefick
They are due to measurement error, sample of a different population, or ... ? What is the unusual event? Does it explain something important about the system that you are working on? I am not telling you not to do what you are doing, but just writing things that I consider when I am doing

Re: [R] Power analysis for Cox regression with a time-varying covariate

2012-07-13 Thread Greg Snow
For something like this the best (and possibly only reasonable) option is to use simulation. I have posted on the general steps for using simulation for power studies in this list and elsewhere before, but probably never with coxph. The general steps still hold, but the complicated part here will

Re: [R] significance test interquartile ranges

2012-07-13 Thread Weidong Gu
Hi Joerg, Seems Mann-Whitney-Wilcoxon test (ks.test in R) would do the work which tests differences anywhere in two distributions, e.g. tails, interquartiles and center. Weidong Gu On Fri, Jul 13, 2012 at 7:32 AM, Schaber, Jörg joerg.scha...@med.ovgu.de wrote: Hi, I have two non-normal

Re: [R] significance test interquartile ranges

2012-07-13 Thread Greg Snow
A permutation test may be appropriate: 1. compute the ratio of the 2 IQR values (or other comparison of interest) 2. combine the data from the 2 samples into 1 pool, then randomly split into 2 groups (matching sample sizes of original) and compute the ratio of the IQR values for the 2 new

Re: [R] Fitting data and removing outliers

2012-07-13 Thread David L Carlson
If not linear, then perhaps nlrob() in package robustbase. - David L Carlson Associate Professor of Anthropology Texas AM University College Station, TX 77840-4352 - Original Message - From: Stephen Sefick ssef...@gmail.com To: Lauren Vogric

Re: [R] significance test interquartile ranges

2012-07-13 Thread Peter Ehlers
On 2012-07-13 13:33, Weidong Gu wrote: Hi Joerg, Seems Mann-Whitney-Wilcoxon test (ks.test in R) would do the work which tests differences anywhere in two distributions, e.g. tails, interquartiles and center. The ks.test() function refers to the Kolmogorov-Smirnov test, not the Wilcoxon test.

[R] integrating multi-dimensional dat along one dimension

2012-07-13 Thread Cable, Sam B Civ USAF AFMC AFRL/RVBXI
I just want to integrate a 3D data set along one dimension to obtain a 2D data set. Something like: (given array d with dim nx,ny,nz ...) data_int-array(dim=c(nx,ny)) for (n in 1:ny) { for (m in 1:nx) { data_int[m,n]-sum(d[m,n,]) } } The thing is, given R's facility with

Re: [R] image.plot transparent?

2012-07-13 Thread Peter Ehlers
On 2012-07-13 06:07, Chris82 wrote: Hello, hiere is a small reproducible example. All z.i which are NA should be transparent at the plot, but they are white colored. ### Example image.plot regular x,y grid ### x - seq(2,2.9,0.1) y - seq(42,42.9,0.1) z - matrix(seq(-5,4.9,0.1),nrow=10)

Re: [R] significance test interquartile ranges

2012-07-13 Thread Weidong Gu
Sorry, I meant Kolmogorov-Smirnov test. Thanks Peter for correction. Weidong On Fri, Jul 13, 2012 at 4:56 PM, Peter Ehlers ehl...@ucalgary.ca wrote: On 2012-07-13 13:33, Weidong Gu wrote: Hi Joerg, Seems Mann-Whitney-Wilcoxon test (ks.test in R) would do the work which tests differences

[R] Species names in distance matrix

2012-07-13 Thread Katharine Miller
I have a function that requires a distance matrix of class dist with species names as row names. For the life of me, I cannot figure out how to get dist() to include species names. I am sure this must be easy, because a lot of packages and functions out there require dist objects to have row

Re: [R] Species names in distance matrix

2012-07-13 Thread Peter Ehlers
On 2012-07-13 15:55, Katharine Miller wrote: I have a function that requires a distance matrix of class dist with species names as row names. For the life of me, I cannot figure out how to get dist() to include species names. I am sure this must be easy, because a lot of packages and functions

Re: [R] Side by side strip charts

2012-07-13 Thread Peter Ehlers
On 2012-07-13 11:37, Rui Barradas wrote: Hello, Or maybe the argument 'pos' of axis(). stripchart(list(sample1=x1,sample2=x2,sample3=x3), method=stack, pch=4, offset=1/2, col=blue, lwd=2, las=1,

Re: [R] integrating multi-dimensional dat along one dimension

2012-07-13 Thread David L Carlson
set.seed(42) d - array(as.integer(round(runif(125)*10, 0)), dim=c(5, 5, 5)) data_int - apply(d, c(1,2), sum) - David L Carlson Associate Professor of Anthropology Texas AM University College Station, TX 77840-4352 - Original Message - From: Sam B

Re: [R] Side by side strip charts

2012-07-13 Thread darnold
Very nice suggestion. I am getting some very kind help here. x1 - round(rnorm(10,60,3)) x2 - round(rnorm(10,65,3)) x3 - round(rnorm(10,70,3)) stripchart(list(sample1=x1,sample2=x2,sample3=x3), method=stack, pch=4, offset=1/2, col=blue, lwd=2,

[R] Arrange two columns into a five variable dataframe

2012-07-13 Thread darnold
Hi, I hope that folks can give me some simple approaches to taking the data set below, which is accumulated in two columns called long and group, then arrange the data is the long column into a data frame containing five variables: Group 1, Group 2, Group 3, Group 4, and Group 5. I am hoping for

Re: [R] Arrange two columns into a five variable dataframe

2012-07-13 Thread Brian Diggs
On 7/13/2012 8:37 PM, darnold wrote: Hi, I hope that folks can give me some simple approaches to taking the data set below, which is accumulated in two columns called long and group, then arrange the data is the long column into a data frame containing five variables: Group 1, Group 2, Group 3,