Re: [R] Help xyplot

2013-02-23 Thread Nicole Ford
The actual data have more than 5 thousand data points, Just want to plot a few #selected randomly. Based on this, it seems you're looking to pull a random sample of 5 from your dataset. Does this link help? http://stat.ethz.ch/R-manual/R-patched/library/base/html/sample.html ~Nicole Ford

Re: [R] Help xyplot

2013-02-23 Thread Nicole Ford
As to your xyplot question, I found a multiline solution. (Below) I am pretty certain there is a multipolt/ graph solution in the effects package (I haven't used that functionality in some years). http://r.789695.n4.nabble.com/XYplot-in-Lattice-Package-td878511.html ~Nicole Ford Ph.D.

[R] Extract, sum and Loop in R

2013-02-23 Thread Anup khanal
Hi all, I have gone through some basics of R in eclipse environment. What I need to work is more than basic level so I could not find out the solution by myself. could anyone help me ? My case, I have climate data (precipitation) in nc format with single layer for each time interval in a day.

[R] anova comparisons

2013-02-23 Thread Robert Zimbardo
I have several linear models on the same data: m1 - lm(y ~ poly(x,1)) m2 - lm(y ~ poly(x,2)) m3 - lm(y ~ poly(x,3)) What I don't understand is why anova(m1, m2, m3, test=F) - yields the same RSS and SS values, but a different p-value from anova(m1, m2, test=F) - when it also yields the SAME as

Re: [R] anova comparisons

2013-02-23 Thread Rolf Turner
On 02/23/2013 08:55 PM, Robert Zimbardo wrote: I have several linear models on the same data: m1 - lm(y ~ poly(x,1)) m2 - lm(y ~ poly(x,2)) m3 - lm(y ~ poly(x,3)) What I don't understand is why anova(m1, m2, m3, test=F) - yields the same RSS and SS values, but a different p-value from

Re: [R] How to merge two functions into one?

2013-02-23 Thread Jonsson
hello Rui, Many thanks. That really helped me.you are totally right about[[4]] -- View this message in context: http://r.789695.n4.nabble.com/How-to-merge-two-functions-into-one-tp4659365p4659446.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] Help xyplot

2013-02-23 Thread Duncan Mackay
Hi Peter Try the 2 examples below - it may give you some ideas useOuterStrips(strip = strip.custom(factor.levels = paste(Year, c(2010:2012)), par.strip.text = list(cex = 0.75)), strip.left = strip.custom(factor.levels = paste(Lat.,

Re: [R] Extract, sum and Loop in R

2013-02-23 Thread Anup khanal
Hi all, I have gone through some basics of R in eclipse environment. What I need to work is more than basic level so I could not find out the solution by myself. could anyone help me ? My case, I have climate data (precipitation) in nc format with single layer for each time interval in a day.

Re: [R] Help with layout

2013-02-23 Thread Greg Snow
Part of the space between the boxplots is the margin area, you can remove that. You can also adjust the width of the box within the plot: layout(matrix(c(1,2,3), 3, 1, byrow = TRUE), heights=c(0.3,0.3,0.6)) op - par(mar=c(0,4,0,2)+0.1) boxplot(rnorm(100), horizontal=TRUE, axes=FALSE, width=1)

[R] Selecting First Incidence from Longitudinal Data

2013-02-23 Thread Tasnuva Tabassum
I have a longitudinal competing risk data of the form: IDCOMPL SEX HEREDITY 1 0 1 2 1 0 1 2 1 3 1 2 2 0 0 1 2 1 0 1 2 2 0 1 2 2 0 1 3 0 0 1 3 0 0 1 3 0

[R] Merging labels on Pie chart

2013-02-23 Thread Melanie Zoelck
Dear R Help Members, I need to draw a pie chart for someone and there are 3 small slices in it identifying different species, all 0.7%, who’s labels overlap so you cannot read them. Is there a way to have only 1 label the three slices, so as to merge the three labels into one without merging

Re: [R] Merging labels on Pie chart

2013-02-23 Thread Uwe Ligges
On 23.02.2013 17:06, Melanie Zoelck wrote: Dear R Help Members, I need to draw a pie chart for someone and there are 3 small slices in it identifying different species, all 0.7%, who’s labels overlap so you cannot read them. Is there a way to have only 1 label the three slices, so as to

Re: [R] Selecting First Incidence from Longitudinal Data

2013-02-23 Thread arun
Hi, Try this: dat1- read.table(text= ID    COMPL  SEX  HEREDITY 1    0  1  2 1    0  1  2 1    3  1  2 2    0  0  1 2    1  0  1 2    2  0  1 2    2  0  1 3    0  0  1 3    0  0  1 3    0  0  1 3    0  0  1 3   

Re: [R] Is it possible to obtain an agglomeration schedule with R cluster analyis

2013-02-23 Thread Uwe Ligges
On 22.02.2013 11:41, Bob Green wrote: Hello, In SPSS the cluster analysis output includes an agglomerations schedule, which details the stages when cases are joined. Is it possible to obtain such output when performing cluster analysis in R? If so, I'd appreciate advice regarding how to

Re: [R] error in unique() command

2013-02-23 Thread Uwe Ligges
On 15.02.2013 13:05, Amir Kasaeian wrote: Dear all, Good day! I have a question in my codes, would you please help me how to rectify it? these are my coded but at the last line I received the error! mac_30 = read.dta(MAC results4.dta) mac_30 map_30 = read.dta(MAP results4.dta) map_30

Re: [R] party::cforest - predict?

2013-02-23 Thread Uwe Ligges
On 14.02.2013 20:29, James Jong wrote: What is the function call interface for predict in the package party for cforest? I am looking at the documentation (the vignette) and ?cforest and from the examples I see that one can call the function predict on a cforest classifier. The method predict

Re: [R] How to install .tar.gz source package in Windows XP 32-bit operational system

2013-02-23 Thread Uwe Ligges
On 13.02.2013 05:38, Marino David wrote: Dear all mailing listers, I failed in install source packages in Windows system. I have installed Rtools in order to install the source package based on the discussion available on the following link:

Re: [R] Selecting First Incidence from Longitudinal Data

2013-02-23 Thread David Winsemius
On Feb 23, 2013, at 6:28 AM, Tasnuva Tabassum wrote: I have a longitudinal competing risk data of the form: IDCOMPL SEX HEREDITY 1 0 1 2 1 0 1 2 1 3 1 2 2 0 0 1 2 1 0 1 2 2 0 1 2 2

Re: [R] anova comparisons

2013-02-23 Thread peter dalgaard
On Feb 23, 2013, at 10:06 , Rolf Turner wrote: What am I missing? A basic understanding of the theory of linear models. This really has little to do with R. Go and read a good intro to linear modelling. Insofar as your question has anything to do with R: When you do

Re: [R] Selecting First Incidence from Longitudinal Data

2013-02-23 Thread arun
Hi, You can also use:  do.call(rbind,lapply(split(dat1,dat1$ID),function(x) head(x[x$COMPL!=0,],1))) #  ID COMPL SEX HEREDITY #1  1 3   1    2 #2  2 1   0    1 #3  3 2   0    1 - Original Message - From: Tasnuva Tabassum t.tasn...@gmail.com To:

Re: [R] Model selection in nonstationary VAR

2013-02-23 Thread Arun Kumar Saha
which method in statistics is completely free from model misspecification? Thanks and regards, _ Arun Kumar Saha, FRM QUANTITATIVE RISK AND HEDGE CONSULTING SPECIALIST Visit me at: http://in.linkedin.com/in/ArunFRM

Re: [R] using and event in deSolve

2013-02-23 Thread Thomas Petzoldt
Hi Jannetta, as far as I can see, your implementation was almost ;-) correct, except that: init[2] - init[1] + d should be: init[2] - init[2] + d The root function with: return(init[1]-30) is correct, because this triggers an event when init[1]-30 crosses the zero line, i.e. when

Re: [R] Model selection in nonstationary VAR

2013-02-23 Thread Uwe Ligges
On 23.02.2013 19:33, Arun Kumar Saha wrote: which method in statistics is completely free from model misspecification? The data. Uwe Ligges Thanks and regards, _ Arun Kumar Saha, FRM QUANTITATIVE RISK AND HEDGE CONSULTING SPECIALIST

Re: [R] Selecting First Incidence from Longitudinal Data

2013-02-23 Thread Rui Barradas
Hello, You can use ?aggregate and ?head to do what you want. Try the following. dat - read.table(text= IDCOMPL SEX HEREDITY 10 1 2 10 1 2 13 1 2 20 0 1 21 0 1 22 0 1 22 0 1 30 0

Re: [R] Climate Spatial plot

2013-02-23 Thread John Kane
The server removed any attached files It is better to put everything in the actual email. https://github.com/hadley/devtools/wiki/Reproducibility John Kane Kingston ON Canada -Original Message- From: berega...@gmail.com Sent: Sat, 23 Feb 2013 02:40:29 +0300 To:

Re: [R] Fitting this data with a gaussian would be great

2013-02-23 Thread Rui Barradas
Hello, Why do you think your data is gaussian? For what it's worth, qqnorm(small) # doesn't look qqline(small) # gaussian Hope this helps, Rui Barradas Em 22-02-2013 23:27, Samantha Warnes escreveu: Hello,I'm still working with this data set, and trying to fit it with a nonlinear model.

Re: [R] Selecting First Incidence from Longitudinal Data

2013-02-23 Thread Xiaogang Su
Try this: dat$sequence - as.vector(unlist(lapply( aggregate(dat$ID, by=list(x), FUN=length)$x, FUN=function(x){seq(1, x dat0 - dat[dat$sequence==1, ] HTH, X On Sat, Feb 23, 2013 at 1:07 PM, Rui Barradas ruipbarra...@sapo.pt wrote: Hello, You can use ?aggregate and ?head to do what you

Re: [R] Selecting First Incidence from Longitudinal Data

2013-02-23 Thread Xiaogang Su
To account for COMP, dat$sequence - as.vector(unlist(lapply( aggregate(dat$ID, by=list(dat$ID), FUN=length)$x, FUN=function(x){seq(1, x dat0 - dat[dat$sequence==1 dat$COMPL!= 0, ] HTH, X On Sat, Feb 23, 2013 at 1:15 PM, Xiaogang Su xiaogan...@gmail.com wrote: Try this: dat$sequence -

Re: [R] Fitting this data with a gaussian would be great

2013-02-23 Thread David Winsemius
On Feb 23, 2013, at 11:09 AM, Rui Barradas wrote: Hello, Why do you think your data is gaussian? For what it's worth, qqnorm(small) # doesn't look qqline(small) # gaussian It's a bit hard to say with such a small sample, isn't it? Here's a poor man's functional data analysis:

[R] how to calculate left kronecker product?

2013-02-23 Thread Michael Friendly
For an application, I have formulas defined in terms of a left Kronecker product of matrices, A,B, meaning A \otimes_L B = {A * B[i,j]} -- matrix on the left multiplies each element on the right. The standard kronecker() function is the right Kronecker product, A \otimes_R B = {A[i,j] * B}

Re: [R] how to calculate left kronecker product?

2013-02-23 Thread Berend Hasselman
On 23-02-2013, at 20:46, Michael Friendly frien...@yorku.ca wrote: For an application, I have formulas defined in terms of a left Kronecker product of matrices, A,B, meaning A \otimes_L B = {A * B[i,j]} -- matrix on the left multiplies each element on the right. The standard

Re: [R] Selecting First Incidence from Longitudinal Data

2013-02-23 Thread arun
HI, Tried your approach:  dat1$sequence - as.vector(unlist(lapply( aggregate(dat1$ID, by=list(dat1$ID),FUN=length)$x, FUN=function(x){seq(1, x)})))  dat0 - dat1[dat1$sequence==1 dat1$COMPL!= 0, ] #your second solution  dat0 #[1] ID   COMPL    SEX  HEREDITY sequence #0 rows (or

Re: [R] Selecting First Incidence from Longitudinal Data

2013-02-23 Thread Xiaogang Su
My bad. I didn't try it out with the real data. Here you go. HTH, X dat - read.table(text= IDCOMPL SEX HEREDITY 10 1 2 10 1 2 13 1 2 20 0 1 21 0 1 22 0 1 22 0 1 30 0 1 30

Re: [R] Is it possible to obtain an agglomeration schedule with R cluster analyis

2013-02-23 Thread Bob Green
Hello Uwes, Thanks. Re-reading the hclust pages I found that using the hclust 'USArrests' data that the command plot (hc1) will generate the order in which cases joined. however, I still can't see how to obtain the respective height at which each case joined each cluster or the height

Re: [R] Fitting this data with a gaussian would be great

2013-02-23 Thread Bert Gunter
FWIW (It may not be much): 1. Data **are never** Gaussian. Failure to reject the hypothesis that the data are sampled from a Gaussian does not mean that the data can be assumed to be drawn from a Gaussian. That depends on the statistical methodology and the application context. 2. Given a large

[R] Wikipedia plots and tables?

2013-02-23 Thread Spencer Graves
Hello, All: What facilities exist for plots and tables of data in the standard MediaWiki software beyond the obvious standards? The standard MediaWiki tables and graphics capabilities seem to me to be rather clumsy, and I wonder if I'm missing some available extensions?

Re: [R] Wikipedia plots and tables?

2013-02-23 Thread Jeff Newmiller
If you look at this question objectively, Spencer, would you not agree that this question is entirely off topic here? --- Jeff NewmillerThe . . Go Live...

Re: [R] Wikipedia plots and tables?

2013-02-23 Thread Spencer Graves
Hi, Jeff: On 2/23/2013 3:12 PM, Jeff Newmiller wrote: If you look at this question objectively, Spencer, would you not agree that this question is entirely off topic here? I can understand why you might think that. However, I believe this lists entertains questions dealing with

Re: [R] Is it possible to obtain an agglomeration schedule with R cluster analyis

2013-02-23 Thread William Dunlap
You didn't show what the tabular summary should look like. However, look at the height and merge components of an hclust object: hc3 - hclust(dist(USArrests[1:8, c(1,2,4)])) data.frame(hc3[2:1]) height merge.1 merge.2 1 9.297849 -1 -8 2 13.609188 -2 -5 3 23.779193

Re: [R] Is it possible to obtain an agglomeration schedule with R cluster analyis

2013-02-23 Thread Bob Green
Willam, Many thanks. I'll check this against my data tomorrow when I'm back at work. This looks just what I wanted. Regards Bob At 09:27 AM 24/02/2013, William Dunlap wrote: You didn't show what the tabular summary should look like. However, look at the height and merge components of an

Re: [R] how to calculate left kronecker product?

2013-02-23 Thread Michael Friendly
Ugh. So simple! Thanks, Berend. On 2/23/2013 2:58 PM, Berend Hasselman wrote: On 23-02-2013, at 20:46, Michael Friendly frien...@yorku.ca wrote: For an application, I have formulas defined in terms of a left Kronecker product of matrices, A,B, meaning A \otimes_L B = {A * B[i,j]} -- matrix

Re: [R] Fitting this data with a gaussian would be great

2013-02-23 Thread Bryan Hanson
Fortune candidate? I hear the landlord is hell, but the company good. Bryan I've already got an apartment reserved for me in one of Pat Burns's R Inferno levels, and I don't want to descend even further. Best, Bert __ R-help@r-project.org

Re: [R] Wikipedia plots and tables?

2013-02-23 Thread Jeff Newmiller
The universe of efficient ways to generate graphics for Wikipedia would be on Wikipedia talk pages somewhere. The universe of ways to make SVG graphics with R could be on topic here. They might intersect, and if other graphics formats that R can generate for Wikipedia are identified through

Re: [R] Plotting survival curves after multiple imputation

2013-02-23 Thread W Robert Long
Can anyone help with this ? On 14/02/2013 14:07, Robert Long wrote: I am working with some survival data with missing values. I am using the mice package to do multiple imputation. I have found code in this thread which handles pooling of the MI results:

Re: [R] Wikipedia plots and tables?

2013-02-23 Thread Spencer Graves
On 2/23/2013 4:35 PM, Jeff Newmiller wrote: The universe of efficient ways to generate graphics for Wikipedia would be on Wikipedia talk pages somewhere. The universe of ways to make SVG graphics with R could be on topic here. They might intersect, and if other graphics formats that R can

Re: [R] Wikipedia plots and tables?

2013-02-23 Thread Ista Zahn
I've not done any of this, but you might look at (a variation of) one of the following tool chains: knitr markdown --pandoc-- mediawiki brew --pander-- mediawiki pander is at http://rapporter.github.com/pander/ Best, Ista On Sat, Feb 23, 2013 at 4:59 PM, Spencer Graves

Re: [R] Merging labels on Pie chart

2013-02-23 Thread Jim Lemon
On 02/24/2013 03:06 AM, Melanie Zoelck wrote: Dear R Help Members, I need to draw a pie chart for someone and there are 3 small slices in it identifying different species, all 0.7%, who’s labels overlap so you cannot read them. Is there a way to have only 1 label the three slices, so as to

Re: [R] Plotting survival curves after multiple imputation

2013-02-23 Thread Frank Harrell
I haven't seen anyone solve this. I think it would be reasonable to do a time point by time point averaging (over multiple imputations) of the underlying survival curve, although there is some question about whether to freeze the centering constant (sum of beta times covariate mean). What will

[R] filling an array

2013-02-23 Thread Jannetta Steyn
Hi All I'm just wondering if there is a quick way of filling a way with the following. I want to declare array I with a specific length and then alternatively fill it with 10 zeros and 10 specified values: v- 14 I - c(0,length(t)) But in stead of just filling I with 0 I want 10 zeros and then

Re: [R] filling an array

2013-02-23 Thread Jim Lemon
On 02/24/2013 02:56 PM, Jannetta Steyn wrote: Hi All I'm just wondering if there is a quick way of filling a way with the following. I want to declare array I with a specific length and then alternatively fill it with 10 zeros and 10 specified values: v- 14 I- c(0,length(t)) But in stead of

Re: [R] filling an array

2013-02-23 Thread Joshua Wiley
Hi Jannetta, Try this: rep(c(0, v), each = 10) See ?rep for details Cheers, Josh On Sat, Feb 23, 2013 at 7:56 PM, Jannetta Steyn janne...@henning.org wrote: Hi All I'm just wondering if there is a quick way of filling a way with the following. I want to declare array I with a

Re: [R] Selecting First Incidence from Longitudinal Data

2013-02-23 Thread Tasnuva Tabassum
Hi Thank you very much, but I forgot to tell that I also want to include the patients for which no complication occurred. That is, for my data I want to include patient no. 4, for which the COMPL value will be 0. In that case, what R function should I write? On Sat, Feb 23, 2013 at 12:23 PM,

Re: [R] Selecting First Incidence from Longitudinal Data

2013-02-23 Thread arun
Hi, Try this: #dat1  do.call(rbind,lapply(split(dat1,dat1$ID),function(x) if(any(x$COMPL!=0)) head(x[x$COMPL!=0,],1) else head(x,1))) #  ID COMPL SEX HEREDITY #1  1 3   1    2 #2  2 1   0    1 #3  3 2   0    1 #4  4 0   1    2 A.K.

[R] data.frame and import to xlsx

2013-02-23 Thread sisi26
Hi, i have a very huge number of data with the size 2375ko, i want to import them for R to xlsx but the size of excel is limited How can i resolve this problem? And please how can i define the frame Note that i have a table rows times c(1.100) columns WLc(200...1000) and inside S

Re: [R] cumulative sum by group and under some criteria

2013-02-23 Thread arun
Hi, d3-structure(list(m1 = c(2, 3, 2), n1 = c(2, 2, 3), cterm1_P0L = c(0.9025, 0.857375, 0.9025), cterm1_P1L = c(0.64, 0.512, 0.64), cterm1_P0H = c(0.9025, 0.9025, 0.857375), cterm1_P1H = c(0.64, 0.64, 0.512)), .Names = c(m1, n1, cterm1_P0L, cterm1_P1L, cterm1_P0H, cterm1_P1H), row.names = c(NA,

Re: [R] cumulative sum by group and under some criteria

2013-02-23 Thread arun
Hi, You can also use ?rowMins() or ?rowMaxs() from library(matrixStats) library(plyr) res2- join(res1,d3,by=c(m1,n1),type=inner)   p0L-0.05 p0H-0.05 p1L-0.20 p1H-0.20   res2- within(res2,{p1- x/m; p2- y/n;term2_p0-dbinom(x1,m1, p0L, log=FALSE)* dbinom(y1,n1,p0H,

Re: [R] locating boxplot in bwplot (lattice)

2013-02-23 Thread Elaine Kuo
Hello, I tried to manipulate the order of boxplots using the reorder below and worked. However, please kindly advise how to specify the colors of each boxplot (bird group), like red, green, and blue, from the left to the right. Thanks again. code bwplot(GE_distance~OF, data=dataN,

Re: [R] Merging data in arrays

2013-02-23 Thread Jeff Newmiller
There is a reason why merge is not designed to work directly with arrays: the matching of rows can easily yield a result with a different number of rows than the initial data had. This plays havoc with the nature of arrays. I would recommend that if a merge is really what you want then