Re: [R] Closest fit data to a particular formula

2012-11-19 Thread Bert Gunter
But ... On Mon, Nov 19, 2012 at 9:23 PM, Jeff Newmiller wrote: > Try using the lm function: ... Better yet, post to a statistics list, like stats.stackexchange.com, as the questions appear primarily statistical, and not R related. Incidentally, loess() is specifically designed to deal with "out

Re: [R] manipulating longitudinal data in r

2012-11-19 Thread Remko Duursma
You can use ave(), like this: ke$maxa <- ave(ke$a, as.factor(ke$patid), FUN=max) greetings, remko -- View this message in context: http://r.789695.n4.nabble.com/manipulating-longitudinal-data-in-r-tp4649855p4650138.html Sent from the R help mailing list archive at Nabble.com.

Re: [R] How to subset my data and at the same time keep the balance?

2012-11-19 Thread Jeff Newmiller
No. --- Jeff NewmillerThe . . Go Live... DCN:Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#.. Playing Research Engineer (S

Re: [R] Closest fit data to a particular formula

2012-11-19 Thread Jeff Newmiller
Try using the lm function: ?lm --- Jeff NewmillerThe . . Go Live... DCN:Basics: ##.#. ##.#. Live Go... Live: OO#.. Dead: OO#..

Re: [R] method show

2012-11-19 Thread Martin Morgan
On 11/19/2012 04:21 PM, Andrea Spano wrote: Hello the list, As a simple example: rm(list = ls())> setClass("tre", representation(x="numeric"))> setMethod("show", "tre", def = function(object) cat(object@x))[1] "show"> setMethod("summary", "tre", def = function(object) cat("This is a tre of v

Re: [R] Help with loess

2012-11-19 Thread Don McKenzie
In your case j$y are the original Y values (response), not the fitted values. Try plot(j$x,fitted(j)) On 19-Nov-12, at 7:20 PM, eric wrote: Not sure what I'm doing wrong. Can't seem to get loess values. It looks like loess is returning the same values as the input. j <-loess(x1$total~a

Re: [R] Help with loess

2012-11-19 Thread Pascal Oettli
Hello, Your problem is not reproducible. Regards, Pascal Le 20/11/2012 12:20, eric a écrit : Not sure what I'm doing wrong. Can't seem to get loess values. It looks like loess is returning the same values as the input. j <-loess(x1$total~as.numeric(index(x1) plot(x1$total,type='l', ylab='M

Re: [R] how to get bootstrap estimates

2012-11-19 Thread eric
You might want to check out the bootstrap package. Also consider clarifying what you want to bootstrap ...mec or vec or what Lastly, it is not clear what you mean when you say ... and I have the next errors: ro 12 = ro (mec,vec) ro 34 = ro (alg,ana) ro 35 = ro (alg,sta) ro 45 = ro (ana,sta

[R] Help with loess

2012-11-19 Thread eric
Not sure what I'm doing wrong. Can't seem to get loess values. It looks like loess is returning the same values as the input. j <-loess(x1$total~as.numeric(index(x1) plot(x1$total,type='l', ylab='M coms/y global',xlab='') lines(loess(total~as.numeric(index(x1)),x1)) The plot statement works fine

Re: [R] help on matrix column removal based on another matrix results

2012-11-19 Thread Irucka Embry
Hi Rui, how are you? I want to thank you for your assistance again. I'm sorry, but the code that you provided for me did not work this time. The code and the warning message are both below: > NSErr <- t(matrix(NSEr)) # which is a 1x1000 double matrix > Vsim[] <- Vsim[ , NSErr > 0.6] Warning me

Re: [R] github

2012-11-19 Thread Steve Lianoglou
Why don't you try clicking on the "Help" link at the top of their site? You can even google "github for dummies" to great success as well ... -steve On Mon, Nov 19, 2012 at 6:07 PM, Muhuri, Pradip (SAMHSA/CBHSQ) wrote: > > Hello, > > I would like to learn how to set up Github/repository and upl

Re: [R] How to subset my data and at the same time keep the balance?

2012-11-19 Thread Brian Feeny
Just curious, once you have a model that works well, does it make sense to then tune it against 100% of the dataset (with known outcomes) so you can apply it to data you wish to predict for or is that a bad approach? I have done like is explained in this thread many times, taken a sample, learn

Re: [R] survfit & number of variables != number of variable names

2012-11-19 Thread Georges Dupret
Hi! It seems the data file wasn't transmit. Please find a copy in attachment. Best, ge On 11/19/2012 09:02 AM, Terry Therneau-2 [via R] wrote: > I can't reproduce the problem. > > Tell us what version of R and what version of the survival package. > Create a reproducable example. I don't know

[R] method show

2012-11-19 Thread Andrea Spano
Hello the list, As a simple example: > rm(list = ls())> setClass("tre", representation(x="numeric"))> > setMethod("show", "tre", def = function(object) cat(object@x))[1] "show"> > setMethod("summary", "tre", def = function(object) cat("This is a tre of > value ", object@x, "\n"))Creating a ge

Re: [R] survfit & number of variables != number of variable names

2012-11-19 Thread David Winsemius
On Nov 19, 2012, at 5:33 PM, Georges Dupret wrote: > Hi David, > > Sorry for the signature files... this is automatic. I should disable that. > > Please find in attachment a copy of small.csv.gz I found it but I suspect nobody else will. I think Terry Therneau already got a copy. when you att

Re: [R] github

2012-11-19 Thread David Winsemius
On Nov 19, 2012, at 6:07 PM, Muhuri, Pradip (SAMHSA/CBHSQ) wrote: > > Hello, > > I would like to learn how to set up Github/repository and upload/update files > and am looking for "Github for Dummies". Any help will be appreciated. Wrong list for this question. -- David Winsemius, MD Alam

Re: [R] kinitr

2012-11-19 Thread Pascal Oettli
Hello, Why don't you search on Internet? Regards, Pascal Le 20/11/2012 10:57, Muhuri, Pradip (SAMHSA/CBHSQ) a écrit : Hello, I am an Intro-level R and ggplot2 user and looking for resources to self teach dynamic report generation in R using knitr. Any advice would be highly appreciated. T

[R] github

2012-11-19 Thread Muhuri, Pradip (SAMHSA/CBHSQ)
Hello, I would like to learn how to set up Github/repository and upload/update files and am looking for "Github for Dummies". Any help will be appreciated. Thanks, Pradip __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinf

[R] kinitr

2012-11-19 Thread Muhuri, Pradip (SAMHSA/CBHSQ)
Hello, I am an Intro-level R and ggplot2 user and looking for resources to self teach dynamic report generation in R using knitr. Any advice would be highly appreciated. Thanks, Pradip __ R-help@r-project.org mailing list https://stat.ethz.ch/mailma

Re: [R] Coefficient of Variation, NA, Aggregate

2012-11-19 Thread Rui Barradas
Hello, Just a note, you can (should?) have an argument na.rm in your function definition with a small modification, like this: co.var <- function(x,na.rm=TRUE) 100*(sd(x,na.rm=na.rm)/mean(x,na.rm=na.rm)) Then you can choose to use the default TRUE or not. Hope this helps, Rui Barradas Em 19

Re: [R] xts plot behavior

2012-11-19 Thread R. Michael Weylandt
http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example RMW On Mon, Nov 19, 2012 at 5:27 PM, swiss_guy wrote: > *Hi > > I have problem with plot.xts . > I try to subset some data in a xts time series.* > > > > *subseting works fore more that one event* > > *But I re

Re: [R] Performing gage R&R study in R w/more than 2 factors

2012-11-19 Thread Bert Gunter
I believe that you need to consult a local statistician, as there are likely way too many statistical issues here that you do not fully understand. Alternatively, try posting to a statistical list like stats.stackexchange.com, as I think most of your issues are primarily statistical, not R related.

Re: [R] Coefficient of Variation, NA, Aggregate

2012-11-19 Thread arun
HI, No problem. You got two NA in the previous example. According to the coefficient of variaion documentation in R (http://hosho.ees.hokudai.ac.jp/~kubo/Rdoc/library/raster/html/cv.html) Compute the coefficient of variation (expressed as a percentage). If there is only a single value, sd is NA

Re: [R] Coefficient of Variation, NA, Aggregate

2012-11-19 Thread Amanda Jones
Fantastic, thank you! On Mon, Nov 19, 2012 at 3:44 PM, arun wrote: > HI, > > Your example dataset is in unreadable format. You could use dput(). > set.seed(5) > mat1<-matrix(sample(c(1:9,NA),20,replace=TRUE),ncol=5) > rowleyi<-data.frame(mat1) > co.var<-function(x) 100*(sd(x,na.rm=TRUE)/mean

Re: [R] Coefficient of Variation, NA, Aggregate

2012-11-19 Thread arun
HI, Your example dataset is in unreadable format.  You could use dput(). set.seed(5)  mat1<-matrix(sample(c(1:9,NA),20,replace=TRUE),ncol=5)  rowleyi<-data.frame(mat1)   co.var<-function(x) 100*(sd(x,na.rm=TRUE)/mean(x,na.rm=TRUE))  rowleyi<-data.frame(subspecies=rep(LETTERS[1:2],2),rowleyi) wit

Re: [R] Plot Area Dimensions

2012-11-19 Thread Greg Snow
The key is to not change the margins, set them once and stick with those margins. The next question then becomes "how do I leave area at the top/bottom for the title and common axis?" to which the answer is "Set outer margins at the beginning". Modifying your code: y<-rnorm(1:100) x<-rnorm(1:100

Re: [R] scatterplot3d and box3d

2012-11-19 Thread Ben Bolker
genome.wustl.edu> writes: > > I created a 3d scatter plot and am trying to change the color of outer box > lines with box3d. > > Anybody can help me to figure out how to do this? > > My example is: > > library(scatterplot3d) > x=seq(1:6) > y=seq(7:12) > z=x*2 > scatterplot3d(x, y,z) This

Re: [R] aggregate() runs out of memory

2012-11-19 Thread David Winsemius
On Nov 19, 2012, at 1:25 PM, Sam Steingold wrote: > Thanks Steve, > what is the analogue of .N for min and max? ?seq > i.e., what is the data.table's version of > aggregate(infl$delay,by=list(infl$share.id),FUN=min) > aggregate(infl$delay,by=list(infl$share.id),FUN=max) > DT[, list( max(v)),

Re: [R] scatterplot3d and box3d

2012-11-19 Thread Duncan Murdoch
On 12-11-19 12:20 PM, x...@genome.wustl.edu wrote: I created a 3d scatter plot and am trying to change the color of outer box lines with box3d. Anybody can help me to figure out how to do this? My example is: library(scatterplot3d) x=seq(1:6) y=seq(7:12) z=x*2 scatterplot3d(x, y,z) See ?scat

Re: [R] Coefficient of Variation, NA, Aggregate

2012-11-19 Thread arun
HI, For the first part, may be this helps: set.seed(5) mat1<-matrix(sample(c(1:9,NA),20,replace=TRUE),ncol=5) rowleyi<-data.frame(mat1)  co.var<-function(x) 100*(sd(x,na.rm=TRUE)/mean(x,na.rm=TRUE))  apply(rowleyi,2,function(x) co.var(x)) #  X1   X2   X3   X4   X5 #53.29387 49.

Re: [R] Ben Bolker's '‘emdbook’ Package , rbetabinom

2012-11-19 Thread Ben Bolker
arun4 gmail.com> writes: > I am using rbetabinom ( to generate beta binomial random variables) function > available in the "emdbook"package written by Professor. Ben Bolker for my > research study. > I have no questions with this function. However, I am looking for the > theoretical method/algori

Re: [R] Is it possible to be sponsored by R?

2012-11-19 Thread Ben Bolker
Christophe Genolini u-paris10.fr> writes: > > Hi the list, > > I am a member of the organizing comity of the French Statistics > Association (SFdS)'s conference. We > are looking for sponsors. Some software (SAS, RITME, ...) > are represented. Do you know if there is > any possibility to be

Re: [R] Import excel file

2012-11-19 Thread Martin Studer
Hi Cyril, please let me know the following details: - sessionInfo() output from R - Version of XLConnect you are using - Version of rJava you are using - Version of Java you are using (complete output of "java -version" on the command line) - Value of the JAVA_HOME environment variable if it is se

[R] Performing gage R&R study in R w/more than 2 factors

2012-11-19 Thread Matt Jacob
Hi everyone, I'm fairly new to R, and I don't have a background in statistics, so please bear with me. ;-) I'm dealing with 2^k factorial designs, and I was just wondering if there's any way to analyze more than two factors of a gage R&R study in R. For example, Minitab has an "expanded gage R&R"

[R] Help: Meta-analysis with metacor

2012-11-19 Thread Catherine Proulx
Trying to do a meta-analysis of correlations in R using the meta package; have tried several things and keep getting a similar error. Can anyone help explain the error? > cor<-c(-0.3018, 0.667, -3.8002, -0.607, -0.4885, -3.8002, -0.0701, 0.1348, > -0.9505, -0.5709, -0.6127, -1.2419, -0.1511, -0

[R] Coefficient of Variation, NA, Aggregate

2012-11-19 Thread Amanda Jones
Hello helpers, I have a two part issue. FIRSTLY, I am attempting to write a function for coefficient of variation, using > co.var <- function(rowleyi) ( 100*sd(rowleyi)/mean(rowleyi) ) #where rowleyi > is my data set, which has multiple columns and rows of data. This is not working because som

[R] scatterplot3d and box3d

2012-11-19 Thread xgao
I created a 3d scatter plot and am trying to change the color of outer box lines with box3d. Anybody can help me to figure out how to do this? My example is: library(scatterplot3d) x=seq(1:6) y=seq(7:12) z=x*2 scatterplot3d(x, y,z) Thanks. Xin __ R-

Re: [R] Plot Area Dimensions

2012-11-19 Thread David L Carlson
You can also use layout() with base graphics. This example sets up a column of 14 strips and allocates 3 strips to the top and bottom graphs and 2 strips To the four middle graphs. Using Richard's tmp dataframe: layout(matrix(c(1, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 6), 14, 1)) layout.show(6) p

[R] Is it possible to be sponsored by R?

2012-11-19 Thread Christophe Genolini
Hi the list, I am a member of the organizing comity of the French Statistics Association (SFdS)'s conference. We are looking for sponsors. Some software (SAS, RITME, ...) are represented. Do you know if there is any possibility to be sponsored by R (or by an association close to R)? Do you th

[R] Find the number of intersections according factor levels

2012-11-19 Thread li li
Dear all, I have two vectors x and y, both of which are of length 1000. I created a factor as.factor(rep(1:100,each=10)). Now I want to count, for each factor level, the number of intersections between x and y. In other words, I would like to count the number of intersections between x[1:10] a

Re: [R] aggregate() runs out of memory

2012-11-19 Thread Steve Lianoglou
Hi, On Mon, Nov 19, 2012 at 1:25 PM, Sam Steingold wrote: > Thanks Steve, > what is the analogue of .N for min and max? > i.e., what is the data.table's version of > aggregate(infl$delay,by=list(infl$share.id),FUN=min) > aggregate(infl$delay,by=list(infl$share.id),FUN=max) > thanks! It would be

Re: [R] aggregate() runs out of memory

2012-11-19 Thread Sam Steingold
Thanks Steve, what is the analogue of .N for min and max? i.e., what is the data.table's version of aggregate(infl$delay,by=list(infl$share.id),FUN=min) aggregate(infl$delay,by=list(infl$share.id),FUN=max) thanks! Sam. On Fri, Sep 14, 2012 at 3:40 PM, Steve Lianoglou wrote: > Hi, > > On Fri, Sep

Re: [R] Error in Sweave but not underlying script

2012-11-19 Thread Duncan Murdoch
On 19/11/2012 3:27 PM, Bush, Daniel P. DPI wrote: No, that did not resolve the issue, but thanks for the suggestion. Here's another possibility: your Sweave session may not be setting the same option defaults in startup code as your regular session. This one just bit me: I normally work wit

Re: [R] Error in Sweave but not underlying script

2012-11-19 Thread Bush, Daniel P. DPI
No, that did not resolve the issue, but thanks for the suggestion. Daniel Bush | School Finance Consultant School Financial Services | Wis. Dept. of Public Instruction daniel.bush -at- dpi.wi.gov | 608-267-9212 -Original Message- From: Duncan Murdoch [mailto:murdoch.dun...@gmail.com]

Re: [R] Plot Area Dimensions

2012-11-19 Thread Richard M. Heiberger
I think this task would be easier in lattice library(lattice) xyplot(y + y + y + y + y + y ~ x, outer=TRUE, layout=c(1,6), strip=FALSE, strip.left=TRUE, ylab="6 copies of the Y variable", main="put an interesting title here") Six different y variables instead of six

Re: [R] simple linear regression with proportion data

2012-11-19 Thread Ben Bolker
On 12-11-19 10:18 AM, S Ellison wrote: > >> -Original Message- >>> Can I use simple linear regression when I have proportion data >>> for both dependent and independent variables? Or, should I use >>> beta regression analysis? Or any suggestion? >>> >> >> The distribution of the indepe

Re: [R] Classification methods - which one?

2012-11-19 Thread Peter Kupfer
Dear Max, first: Thanks a lot for your suggestion and the open words about methods in real life. I guess: Thats my problem. Regarding my analysis: Yes, thats the problem and I have to coerce to do this analysis regarding lack of time to start something/other methods. So you suggest Linear Discr

Re: [R] generated list element names

2012-11-19 Thread David Winsemius
On Nov 19, 2012, at 10:46 AM, William Dunlap wrote: If you have a list and want to add a new (or replace a) named component use myList[[compName]] <- compValue as in myList <- list() compName <- "Incr" compValue <- function(x) x + 1 myList[[compName]] <- compValue If you want to make

[R] xts plot behavior

2012-11-19 Thread swiss_guy
*Hi I have problem with plot.xts . I try to subset some data in a xts time series.* *subseting works fore more that one event* *But I receive nothing, If I try to get one event * I'm happy for every hint! Thanks! -- View this message in context: http://r.789695.n4.nabble.com/xts-plot-

Re: [R] survfit & number of variables != number of variable names

2012-11-19 Thread Georges Dupret
Hi! In answer to: I noticed that you were using what might be called an "externally created Surv object". I have a memory that Terry Therneau has criticized that practice. I cannot remember if it was in exactly this situation but I might ask if setting up the model as: cox = coxph

Re: [R] Biologist R learner

2012-11-19 Thread chuck.01
Please take the advice of Berend if you ever want to get help here. Also, you will need to do some basic and initial work yourself; read what he suggested, use Google to search keywords, and see great help like this: http://cran.r-project.org/doc/contrib/Short-refcard.pdf also, use the built in

Re: [R] survfit & number of variables != number of variable names

2012-11-19 Thread Carina Salt
Hi - I've seen a similar issue going on with survfit when using strata in the model, although I get a different error message from ge. If it helps to track down the problem (rather than confusing things further) here is some code that should reproduce the issue I've seen. I'm running R 2.15.2, wi

[R] Plot Area Dimensions

2012-11-19 Thread Richard James
Dear colleagues, I wish to create a figure with 6 plots arranged vertically with no spacing between them as they all have a common x-axis. However, using the code below I'm unable to get the plot area the same size for each plot. The bottom plot with the x-axis label is smaller than the others

Re: [R] generated list element names

2012-11-19 Thread jim holtman
I missed the last snipet; just saw the first. So you have your solution. If you want a function, try: > f.newList <- function(x,name){.x <- list(x);names(.x) <- name;.x} > f.newList(10, paste('f', 'oo', sep = '')) $foo [1] 10 On Mon, Nov 19, 2012 at 1:32 PM, Sam Steingold wrote: >> * jim holt

[R] Help vectorizing data generation for IRT graded response model

2012-11-19 Thread drj571
Hello, I have code that will generate data for a 5 category IRT graded response model. However, the code could be improved through vectorizing. Here is the code below: ###Inputs N <- 100 #Number of people taking test n <- 10 #Number of items nCat <- 5 #number of categories ###Generate Item pa

Re: [R] lattice: defining grouping variable only for the upper/lower panel with splom

2012-11-19 Thread ilai
On Mon, Nov 19, 2012 at 5:42 AM, AnjaM wrote: > Using the mtcars dataset, how to define the grouping variable to be valid > only for the upper or lower panel? > > The following doesn't work: > > # Code start > > Almost : splom(~data.frame(mpg, disp, hp, drat, wt, qsec), > data=mtcars, psca

Re: [R] How to subset my data and at the same time keep the balance?

2012-11-19 Thread Eddie Smith
Thanks a lot! I got some ideas from all the replies and here is the final one. newdata select <- sample(nrow(newdata), nrow(newdata) * .7) data70 <- newdata[select,] # select write.csv(data70, "data70.csv", row.names=FALSE) data30 <- newdata[-select,] # testing write.csv(data30, "data30.csv",

Re: [R] survfit & number of variables != number of variable names

2012-11-19 Thread Georges Dupret
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi Terry, I attached a small data set to this email. This is what I get (I restricted the formula to avoid NA's): > surv = with(small, Surv(time=absence, event=(censored==FALSE))) > (cox.s = coxph(surv ~ bucket*(today) + strata(activity), data = >

Re: [R] generated list element names

2012-11-19 Thread William Dunlap
If you have a list and want to add a new (or replace a) named component use myList[[compName]] <- compValue as in myList <- list() compName <- "Incr" compValue <- function(x) x + 1 myList[[compName]] <- compValue If you want to make a new list-with-names from scratch try structur

Re: [R] generated list element names

2012-11-19 Thread Sam Steingold
> * jim holtman [2012-11-19 13:14:05 -0500]: > > How about this (if you don't like writing two lines, encapsulate it in > a function): > >> x <- list(10) >> names(x) <- paste('f', 'oo', sep = '') >> str(x) > List of 1 > $ foo: num 10 >> I am sorry, how is this different from my second snippet (e

Re: [R] additive interaction for a dichotomous dependent variable (i.e. risk difference)

2012-11-19 Thread David Winsemius
On Nov 19, 2012, at 1:57 AM, wouterjohannes wrote: No, I never got any response. I used an article by Knol to solve the issue. Ik hope this is useful for you too. Best regards, Wouter Knol, M.J., van, d.T., Grobbee, D.E., Numans, M.E., Geerlings, M.I., 2007. Estimating interaction on a

Re: [R] generated list element names

2012-11-19 Thread jim holtman
How about this (if you don't like writing two lines, encapsulate it in a function): > x <- list(10) > names(x) <- paste('f', 'oo', sep = '') > str(x) List of 1 $ foo: num 10 > On Mon, Nov 19, 2012 at 1:07 PM, Sam Steingold wrote: > How can I create lists with element names created on the fly?

[R] generated list element names

2012-11-19 Thread Sam Steingold
How can I create lists with element names created on the fly? --8<---cut here---start->8--- > list (foo = 10) $foo [1] 10 > list ("foo" = 10) $foo [1] 10 > list (paste("f","oo",sep="") = 10) Error: unexpected '=' in "list (paste("f","oo",sep="") =" --8<---

Re: [R] How to subset my data and at the same time keep the balance?

2012-11-19 Thread arun
HI, May be this helps: dat1<-read.table(text="   V1 V2 1 5 10 2 6  3 3 8  4 4 9 20 5 15 30 6 25 40 7 2  4 8 3  1 9 1  5 10 8 10 ",header=TRUE) dat2<-dat1[sample(NROW(dat1),NROW(dat1)*(1-0.3)),] #70% of data dat2$newcol<-TRUE  dat1$newcol1<-TRUE  dat4<-merge(dat1,dat2,by=c("V1","V2"),all=TRUE)  dat5

[R] how to get bootstrap estimates

2012-11-19 Thread Tania Patiño
Hello all, could you explain me, how to get bootstrap estimates if i have the next data: >scor mec vec alg ana sta 1 77 82 67 67 81 2 63 78 80 70 81 3 75 73 71 66 81 4 55 72 63 70 68 5 63 63 65 70 63 6 53 61 72 64 73 7 51 67 65 65 68 8 59 70 68 62

Re: [R] How to subset my data and at the same time keep the balance?

2012-11-19 Thread Sarah Goslee
I'm not sure what you mean by "balance", but you can use sample() to randomly order the values 1:1000, then use the first 700 as row indices for the first set, and the last 300 as the test set. Sarah On Mon, Nov 19, 2012 at 12:16 PM, Eddie Smith wrote: > Hi guys, > > I have 1000 rows of a datase

Re: [R] How to subset my data and at the same time keep the balance?

2012-11-19 Thread Rui Barradas
Hello, See the following example. x <- matrix(rnorm(2000), ncol = 2) idx <- sample(nrow(x), 0.7*nrow(x)) x2 <- x[idx, ] nrow(x2) # 700 x3 <- x[-idx, ] nrow(x3) # 300 Hope this helps, Rui Barradas Em 19-11-2012 17:16, Eddie Smith escreveu: Hi guys, I have 1000 rows of a dataset. In my ana

[R] How to subset my data and at the same time keep the balance?

2012-11-19 Thread Eddie Smith
Hi guys, I have 1000 rows of a dataset. In my analysis, I need 70% of the data, run my analysis and then use the remaining 30% to test my model. Could anybody kindly help me on this? Cheers __ R-help@r-project.org mailing list https://stat.ethz.ch/mai

[R] expand time period

2012-11-19 Thread dms
I'd like to expand the following data to perform a daily time series. It should cover from '2012-07-01' to '2012-10-06' with the values I actually have being the mean from one point measurement to another. Does anyone has a clue to perform this task. structure(list(Date.beg = structure(c(15635, 1

Re: [R] survfit & number of variables != number of variable names

2012-11-19 Thread Terry Therneau
I can't reproduce the problem. Tell us what version of R and what version of the survival package. Create a reproducable example. I don't know if some variables are numeric and some are factors, how/where the "surv" object was defined, etc. Terry Therneau On 11/17/2012 05:00 AM, r-help-req

Re: [R] manipulating longitudinal data in r

2012-11-19 Thread Michael Dewey
At 17:13 18/11/2012, Jeff Newmiller wrote: Michael, this comment doesn't seem appropriate to the question, since the sample data is a ragged array that requires the addition of NAs to fit into a wide format. It does now but we do not know whether that was how it started life. My remarks were

Re: [R] help on matrix column removal based on another matrix results

2012-11-19 Thread Rui Barradas
Sorry, the comma is in the wrong place, it should be Vsim[] <- Vsim[ , NSErr > 0.6] Rui Barradas Em 19-11-2012 16:18, Rui Barradas escreveu: Hello, Try Vsim[] <- Vsim[NSErr > 0.6, ] Hope this helps, Rui Barradas Em 19-11-2012 14:30, iembry escreveu: Hi everyone, now I am trying to finish

Re: [R] Biologist R learner problem!!!help pls

2012-11-19 Thread Berend Hasselman
On 19-11-2012, at 15:48, Anna23 wrote: > . Q>>>Use the built in dataset called iris in this task. > (a) Calculate the result of following formula separately in every species > for all of the > numerical variables: log(x)/x. > (b) Calculate trimmed mean for each of the numerical variables using >

Re: [R] Biologist R learner

2012-11-19 Thread Berend Hasselman
On 19-11-2012, at 15:32, andrew wrote: > I am a Biologist and a beginner, please help me to solve this: please > anyone..its my homework and I dont have a clue abt R yet.. > Write a function which does the following tasks: > > (a) Calculates minimum and maximum value of a given argument x. > (

Re: [R] help on matrix column removal based on another matrix results

2012-11-19 Thread Rui Barradas
Hello, Try Vsim[] <- Vsim[NSErr > 0.6, ] Hope this helps, Rui Barradas Em 19-11-2012 14:30, iembry escreveu: Hi everyone, now I am trying to finish writing the code (I had asked for assistance on subtracting arrays) This is what I what I am running in R: source("/home/ie/Documents/TTU/GA_R

Re: [R] RMySQL install on windows

2012-11-19 Thread Jeffrey Horner
Sorry for not taking care of this... If anyone would like to take over maintainership of RMySQL I'm sure the R community would greatly appreciate it. I just don't have the time these days. Jeff [[alternative HTML version deleted]] __ R-help@r-p

[R] Ben Bolker's '‘emdbook’ Package , rbetabinom

2012-11-19 Thread arun4
Hello, I am using rbetabinom ( to generate beta binomial random variables) function available in the "emdbook"package written by Professor. Ben Bolker for my research study. I have no questions with this function. However, I am looking for the theoretical method/algorithm of the function "rbetabi

[R] Question about Package 'sampleSection' for IRT model

2012-11-19 Thread Kamontip Srihaset
Dear All, I am Ph.D student at Chulalongkorn University in Thailand, I want to use Package 'sampleSection' to estimate missing data which generate under IRT model(3-PL); n<-500 ## number of examinee I<-20 ## number of items num.imp<-5 ##number of imputations p.missing<-c(0.09, 0.01) #prob of

Re: [R] Stepwise regression scope: all interacting terms (.^2)

2012-11-19 Thread Mark Ebbert
David, thanks for the feedback! Steve, thanks for the direction! I have heard and read some about Dr. Harrell's work but somehow had missed the term "penalized logistic regression." That was helpful for finding more specific sources to follow Dr. Harrell's (and other's) suggestions. I may have

[R] R SNA: Creating a adjacency matrix containing all actors but only values of a subset

2012-11-19 Thread Daniel Hain
1 down vote favorite my problem is the following: I am using the R SNA package for social network analysis. Lets say, my starting point is an edgelist with the following characteristics. Every row contains a firm name, the ID of a project they are involved and further characteristics, l

[R] Biologist R learner problem!!!help pls

2012-11-19 Thread Anna23
. Q>>>Use the built in dataset called iris in this task. (a) Calculate the result of following formula separately in every species for all of the numerical variables: log(x)/x. (b) Calculate trimmed mean for each of the numerical variables using apply–function. Choose your own trimming percentage

[R] help on matrix column removal based on another matrix results

2012-11-19 Thread iembry
Hi everyone, now I am trying to finish writing the code (I had asked for assistance on subtracting arrays) This is what I what I am running in R: > source("/home/ie/Documents/TTU/GA_Research/GLUE/R-Project/R_GLUE_Example/NSEr.R") NSEr <- function (obs, sim) { {jjh <- (as.vector(obs) - sim)^2 Xjjhs

Re: [R] loop to subtract arrays / error

2012-11-19 Thread arun
HI, May be this helps: Vobsr<-read.table(text=" 81.071 73.187 66.991 62.482 59.662 58.529 59.085 61.328 65.259 70.878 ",sep="",header=FALSE) Vsimr=read.table(text=" 81.07 81.07 73.19 73.19 65.81 67.16 58.93 63 52.55 60.7 46.68 60.25 41.31 61.67 36.44 64.95 32.08 70.08 28.22 77.08 ",sep="",header=F

[R] Biologist R learner

2012-11-19 Thread andrew
I am a Biologist and a beginner, please help me to solve this: please anyone..its my homework and I dont have a clue abt R yet.. Write a function which does the following tasks: (a) Calculates minimum and maximum value of a given argument x. (b) If x is positive, some new vector gets the value

[R] lattice: defining grouping variable only for the upper/lower panel with splom

2012-11-19 Thread AnjaM
Using the mtcars dataset, how to define the grouping variable to be valid only for the upper or lower panel? The following doesn't work: # Code start splom(~data.frame(mpg, disp, hp, drat, wt, qsec), data=mtcars, pscales=0, auto.key=list(columns=3), upper.panel = function(...){

Re: [R] R-Square in WLS

2012-11-19 Thread frespider
Hi Peter, why you are involving -1 with this concept? Can you explain more please Cheers Date: Sun, 18 Nov 2012 23:28:26 -0800 From: ml-node+s789695n4650012...@n4.nabble.com To: frespi...@hotmail.com Subject: Re: R-Square in WLS On Nov 18, 2012, at 21:32 , Thomas Lumley wrote: >

[R] RQuantlib - Convertible Bond Pricing

2012-11-19 Thread colaiutachambers
Hi everyone, I’m working on my Master’s Degree thesis about the pricing of C.B. trying to do that with “R”. I read the paper “RQuantLib: Interfacing QuantLib from R” and now I’m matching several market price (taken from Bloomberg or Deutsche Bank database) with “R” output. Could you help me to unde

Re: [R] Stepwise analysis with fixed variables

2012-11-19 Thread Einat
Thank you for the quick reply. Two more questions: 1. For example, if this is my code: >RegModel = lm(glucose~sex+BMI+height+weight+education+ses,weight=w_without_non_response) >summary(RegModel) >step(RegModel, direction ="backward",scope=list(lower=?,upper=?)) and I want the sex and height var

Re: [R] additive interaction for a dichotomous dependent variable (i.e. risk difference)

2012-11-19 Thread wouterjohannes
Hi, No, I never got any response. I used an article by Knol to solve the issue. Ik hope this is useful for you too. Best regards, Wouter Knol, M.J., van, d.T., Grobbee, D.E., Numans, M.E., Geerlings, M.I., 2007. Estimating interaction on an additive scale between continuous determinants in

Re: [R] side by side boxplots

2012-11-19 Thread lbp
I want to plot the results of multiple paired comparison in a side-by-side, in opposite direction with the standard error, graph. Would you please give me some help of howto. Thanks. Charlie. lbp [[alternative HTML version deleted]] __ R

[R] Classification methods - which one?

2012-11-19 Thread Peter Kupfer
Dear all, i searched for some classification methods and I have no glue if i took the right once. My problem: I have a matrix with 17000 rows and 33 colums (genes and patients). The patients are grouped into 3 diseases. No I want to classify the patients and for sure i want to know which rows are

Re: [R] simple linear regression with proportion data

2012-11-19 Thread S Ellison
> -Original Message- > > Can I use simple linear regression when I have proportion data for > > both dependent and independent variables? Or, should I use beta > > regression analysis? Or any suggestion? > > > > The distribution of the independent variable is irrelevant > (in so

Re: [R] Calculateing means

2012-11-19 Thread S Ellison
> I have a data matrix with 570 columns containing 95 (samples) > with 6 replicates each. > How can I calculate the mean of the replicates for 95 samples? Write a function that calculates the sample means for a vector of 95 observations and then use apply() to apply that function to the whole

Re: [R] loop to subtract arrays / error

2012-11-19 Thread Irucka Embry
Hi Arun, thanks for your assistance. That worked as well. Irucka <-Original Message-> >From: arun [smartpink...@yahoo.com] >Sent: 11/19/2012 7:22:09 AM >To: iruc...@mail2world.com >Cc: r-help@r-project.org >Subject: Re: [R] loop to subtract arrays / error > >HI, >May be this helps: > >Vo

Re: [R] function customization

2012-11-19 Thread maxbre
thank you all for the great help, in particular to dennis murphy in order to close the thread I'm posting here the final solution to my question new.ex<-structure(list(TEC = c(0.21, 0.077, 0.06, 0.033, 0.014, 0.007, 0.21, 0.077, 0.01, 0.033, 0.05, 0.014),

Re: [R] list.files, recursively

2012-11-19 Thread Jannis
Thanks, Rui and Jim, for your replies. I tried to post this question to r.devel but its admin told me that the question rather belongs into r-help. Thanks, Jim, for your suggestion. I have already constructed something similar. I posted my question to suggest modifying the function so that not

[R] internal cluster quality indexes

2012-11-19 Thread eliza botto
Dear useRs, I wanted to know something about the Index.G2 and Index.G3 which Calculate G2 and G2 internal cluster quality indexes. i tried to find material from internet but it seems that the file have been removed. Is it good to have higher values of these indexes or lower? thanks in advan

Re: [R] loop to subtract arrays / error

2012-11-19 Thread Irucka Embry
Hi Rui, thank-you. That was simple and worked great. Irucka <-Original Message-> >From: Rui Barradas [ruipbarra...@sapo.pt] >Sent: 11/19/2012 4:13:24 AM >To: iruc...@mail2world.com >Cc: r-help@r-project.org >Subject: Re: [R] loop to subtract arrays / error > >Hello, > >Or simpler, sin

Re: [R] loop to subtract arrays / error

2012-11-19 Thread Irucka Embry
Hi Rui Barradas, how are you? Thank-you very much. That worked perfectly. Irucka Embry <-Original Message-> >From: Rui Barradas [ruipbarra...@sapo.pt] >Sent: 11/19/2012 4:05:11 AM >To: iruc...@mail2world.com >Cc: r-help@r-project.org >Subject: Re: [R] loop to subtract arrays / error >

Re: [R] How to retrieve data from a matrix

2012-11-19 Thread ginger
Thank you very much, It works! -- View this message in context: http://r.789695.n4.nabble.com/How-to-retrieve-data-from-a-matrix-tp4649721p4650036.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.org mailing list http

  1   2   >