Re: [R] Please help(urgent) - How to simulate transactional data for reliability/survival analysis

2017-07-04 Thread Sunny Singha
ow to use the other columns in you data set > (e.g., the event(0/1)). > > Mark > R. Mark Sharp, Ph.D. > msh...@txbiomed.org > > > > > >> On Jul 4, 2017, at 7:02 AM, Sunny Singha >> wrote: >> >> Thanks Boris and Bret, >> I was successfu

Re: [R] Please help(urgent) - How to simulate transactional data for reliability/survival analysis

2017-07-04 Thread Sunny Singha
Thanks Boris and Bret, I was successful in simulating granular/transactional data. Now I need some guidance to transform the same data in format acceptable for survival analysis i.e below format: pump_id | event_episode_no. | event(0/1) | start | stop | time_to_dropout The challenge I'm experienc

[R] Fwd: Please help(immediate) - How to simulate transactional data for reliability/survival analysis

2017-06-27 Thread Sunny Singha
I apologise as I had mistakenly posted this message via non- member mail. So I'm reposting it with member id. I need help in this case. > Hi friends, > I haven't done such a simulation before and any help would be greatly > appreciated. I need your guidance. > > I need to simulate end to end

[R] Help to simulate data to model pump failure use case

2017-06-15 Thread Sunny Singha
t; -ve_corr( +ve_corr(discharge_pressure + flow) + temprature) -- worn shafts --> +ve_corr(discharge_pressure + flow) How should I be generate distributions for the variables listed in the "failure modes" maintaining the correlation stated above. Regards, Sunny

[R] Generate correlated expontial distribution -- lamda please guide

2017-06-15 Thread Sunny Singha
Hi, I need to generate correlated (positive as well as negative) bivariate exponential distribution with rate of 1/5 or any rate I need some guidance here. Please help. Regards, Sunny __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more

Re: [R] Please assist -- Unable to remove '-' character from char vector--

2016-04-25 Thread Sunny Singha
ases to be specified in the regex ? Regards, Sunny Singha. On Mon, Apr 25, 2016 at 12:39 PM, Jim Lemon wrote: > Hi Sunny, > Try this: > > # notice that I have replaced the fancy hyphens with real hyphens > end<-c("2001-","1992-","2013-","2013-&quo

[R] Please assist -- Unable to remove '-' character from char vector--

2016-04-24 Thread Sunny Singha
single values but not from ranges. Please guide. > gsub('[-|,]', '', end) [1] "2001" "1992" "2013" "2013" "2013" "2013" "2003" [8]

[R] R cannot allocate a vector of size 5.4mb

2016-04-11 Thread Jijo Sunny George
execution time of my loop but after doing that i ran into the above mentioned error Thanks & Regards Jijo Sunny DISCLAIMER: "The information in this e-mail and any atta...{{dropped:12}} __ R-help@r-project.org mailing list -- To UNSUBSCR

Re: [R] Please guide -- UTF-8 locale setting fails on Windows on writing

2016-03-28 Thread Sunny Singha
Milan, Anwer to your queries: -- But how do you read back the contents of the file? You need to specify the encoding when reading it too. Answer: I read back as stated in 'Case 2' -- Are you sure the notepad saved the text as UTF-8? Answer: Yes. Regards, Sunny On Mon, Mar 28, 2016

Re: [R] Please guide -- UTF-8 locale setting fails on Windows on writing

2016-03-28 Thread Sunny Singha
ding social media data extracted, which ultimately is somewhere using httr package and returning data frames. I'm not sure how should I get it handled in Windows as I don't observe this behavior in Mac where system locase is set to 'en_US.UTF-8' Regards, Sunny On Mon, Mar

[R] Please guide -- UTF-8 locale setting fails on Windows on writing

2016-03-28 Thread Sunny Singha
nd-windows/ I'm not sure whether the issue is while reading/extracting the data from media or while writing/exporting in Windows directory, but I don't experience similar issue in my personal Mac machine. I need some clarification here. How could I expo

Re: [R] Please guide -- Error during export in csv format

2016-03-21 Thread Sunny Singha
you would have observed in error message it wasn't interpreted as above but some other nonsensical characters (posts_Hi nhng ngui dng > hành cùng line). Is there a workaround to handle such strings ? Regards, Sunny On Mon, Mar 21, 2016 at 6:29 PM, Sunny Singha wrote: > Thanks Ben,

[R] Please guide -- Error during export in csv format

2016-03-21 Thread Sunny Singha
x27;,grp_id,'.csv')) my.file2 <- file.path('./', paste0('posts','_',name,'_',grp_id,'.csv')) write.csv(posts_frame, file=my.file2, row.names = F) write.csv(likes_frame, file = my.file1, row.names = F) Regards, Sunny __

Re: [R] Please help -- Cbind data frames within LIST() in R

2016-03-14 Thread Sunny Singha
ile=myfile, row.names = F) } } } Here I call the above function: # Call page_data_extract() function for each pages found to gather posts, comments & Likes for(i in 1:nrow(pages_df)){ e_catch <- try(page_data_extract(pages_df$id[i])) if(isTRUE(all.equal(class(e_catch), '

[R] Please help -- Cbind data frames within LIST() in R

2016-03-14 Thread Sunny Singha
data frame are of unequal length. hence, missing values will be filled with 'NA' after combining* Regards, Sunny [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz

[R] Help -- feed data frames, returned from function into list --

2016-03-09 Thread Sunny Singha
#x27;facebook) for(i in 1:length(groups)){ g <- list() g[[i]] <- searchGroups_mod(*groups[i]*, token=fb_oauth, 10) } The result list stores data frame only for the last string in the 'groups' vector. Why the List is getting reassigned for each iteration ? Please guide. Regards,

Re: [R] Question regarding lattice::levelplot and distribution of colors

2014-07-07 Thread Sunny Srivastava
= 0.5, > rot = 90), > y = list(cex = 0.5), > alternating = FALSE), > xlim = c(0, 50), > colorkey = list(labels = paste(seq(-0.2,0, 0.025)), >

Re: [R] Question regarding lattice::levelplot and distribution of colors

2014-07-06 Thread Sunny Srivastava
for the color key limits. Best, Sanvesh On Sun, Jul 6, 2014 at 11:59 PM, David Winsemius wrote: > > On Jul 6, 2014, at 4:35 PM, Sunny Srivastava wrote: > > > Hello R-helpers: > > > > I think there is some problem with my code, but I would like to seek you >

[R] Question regarding lattice::levelplot and distribution of colors

2014-07-06 Thread Sunny Srivastava
Hello R-helpers: I think there is some problem with my code, but I would like to seek you help because I can't spot it. I have a data.frame defined as follows: testdf <- structure(list(yy = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L), .Label = c("R", "L"), class =

Re: [R] Strings from different locale

2011-05-26 Thread sunny
hanging my locale to 'all; >> locales? >> >> I don't know what locale the string is in, is there a way to detect this >> or >> translate >> > Thanks! I was having a similar problem with some non-English characters (such as the e-acute) causing memory corru

Re: [R] new to loops

2011-05-08 Thread sunny
Maybe this is what you're looking for: # x is your set of explanatory variables (10 of them): x <- array(rnorm(1), dim=c(1000,10)) # y is your dependent variable: y <- rbinom(1000, 1, 0.3) # run the regression on each column of x: reg <- apply(x, 2, function(z) glm(y ~ z, family=binomial(lin

Re: [R] split character vector by multiple keywords simultaneously

2011-05-08 Thread sunny
Andrew Robinson-6 wrote: > > A hack would be to use gsub() to prepend e.g. XXX to the keywords that > you want, perform a strsplit() to break the lines into component > strings, and then substr() to extract the pieces that you want from > those strings. > > Cheers > > Andrew > Thanks, that go

[R] split character vector by multiple keywords simultaneously

2011-05-04 Thread sunny
Hi. I have a character vector that looks like this: > temp <- c("Company name: The first company General Manager: John Doe I > Managers: John Doe II, John Doe III","Company name: The second company > General Manager: Jane Doe I","Company name: The third company Managers: > Jane Doe II, Jane Doe II

Re: [R] Matching package - Match function

2011-03-26 Thread sunny
n the distance.tolerance option. sunny wrote: > > Hi. > > I am using the Matching package for propensity score matching. For each > treated unit, I want to find all control units whose propensity scores lie > within a certain distance from the treated unit. The sample code is as

[R] Matching package - Match function

2011-03-25 Thread sunny
Hi. I am using the Matching package for propensity score matching. For each treated unit, I want to find all control units whose propensity scores lie within a certain distance from the treated unit. The sample code is as follows: > library(Matching) > x <- rnorm(10) > y <- rnorm(10) > z

Re: [R] [plyr] Question regarding ddply: use of .(as.name(varname)) and varname in ddply function

2010-12-06 Thread Sunny Srivastava
ot;cyl")), mtcars) > > But you shouldn't need to do any syntactic hackery because the default > method automatically parses the string for you: > > eval.quoted(as.quoted("cyl"), mtcars) > > Hadley > > On Mon, Dec 6, 2010 at 6:22 PM, Sunny Srivasta

Re: [R] [plyr] Question regarding ddply: use of .(as.name(varname)) and varname in ddply function

2010-12-06 Thread Sunny Srivastava
, 2010 at 5:28 PM, Hadley Wickham wrote: > On Mon, Dec 6, 2010 at 3:58 AM, Sunny Srivastava > wrote: > > Dear R-Helpers: > > > > I am using trying to use *ddply* to extract min and max of a particular > > column in a data.frame. I am using two d

[R] [plyr] Question regarding ddply: use of .(as.name(varname)) and varname in ddply function

2010-12-06 Thread Sunny Srivastava
Dear R-Helpers: I am using trying to use *ddply* to extract min and max of a particular column in a data.frame. I am using two different forms of the function: ## var_name_to_split is a string -- something like "var1" which is the name of a column in data.frame ddply( df, .(as.name(var_name_to_

Re: [R] Split-split plot design with aov function in R

2010-09-27 Thread Sunny Srivastava
http://www.amazon.com/Statistical-Design-George-Casella/dp/1441926143/ref=sr_1_1?s=gateway&ie=UTF8&qid=1285609902&sr=8-1 Hello Mohd. Yaseen, Please check out the book by Dr. Casella and his website www.stat.ufl.edu/~casella for the relevant R codes. Chapter 5 of this book talks about Split Split P

Re: [R] Question: how to obtain the clusters of genes (basically the ones in the row dendrograms) from an object obtained by heatmap.2 function

2010-09-16 Thread Sunny Srivastava
Thanks Michael for your help. At least its good to know that there is no function which does what I wanted. I will definitely try to code something that fulfills my requirements. Regards, S. On Fri, Sep 17, 2010 at 2:32 AM, Michael Bedward wrote: > Hello Sunny, > > Defining groups a

[R] Question: how to obtain the clusters of genes (basically the ones in the row dendrograms) from an object obtained by heatmap.2 function

2010-09-16 Thread Sunny Srivastava
Hello R-Helpers, I have a question about extracting the clusters of genes after we make the heatmap (say ht4) using the heatmap.2 function. Basically, I want to get the clusters which are shown as row dendrogram in the heatmap. I understand that ht4$rowDendrogram is an object of dendrogram and it

Re: [R] Question: Form a new list with the index replicated equal to the number of elements in that index

2010-09-13 Thread Sunny Srivastava
Thank you very much list! On Mon, Sep 13, 2010 at 5:04 PM, Phil Spector wrote: > Sunny - > I don't think mapply is needed: > > lapply(1:length(mylist),function(x)rep(x,length(mylist[[x]]))) >> > [[1]] > [1] 1 1 1 > >

[R] Question: Form a new list with the index replicated equal to the number of elements in that index

2010-09-13 Thread Sunny Srivastava
Dear R-Helpers, I have a list l1 like: l1[[1]] a b c l1[[2]] d l1[[3]] e f I want an output res like: res[[1]] 1 1 1 res[[2]] 2 res[[3]] 3 3 Essentially, I want to replicate each index equal to the number of elements present in that index. Below is what I do to accomplish this: l1 <- list

Re: [R] P values

2010-05-08 Thread Sunny Srivastava
Dear R-Users, This list is observed by many great statisticians and non-statisticians. I just want to add this valuable link to this great discussion. http://www.stat.duke.edu/~berger/p-values.html Thanks and Best Regards, S. On Sat, May 8, 2010 a

Re: [R] Expectation of E(x^1/2)

2010-04-10 Thread Sunny Srivastava
Dear Haneef, Pls see if this suits your requirement. sim.norm = rnorm(1,mean=a,sd=sqrt(b)) mean.est = mean(sqrt(sim.norm)) Thx S. On Sat, Apr 10, 2010 at 9:31 PM, Haneef Anver wrote: > Hi all, > > > I am trying to find the expectation of x^1/2 where x~N(a,b) ( Normal with > mean a and vari

[R] How the change the dimension of an individual cell [i.e. the cell corresponding to an observation in data matrix] in a heatmap.2?

2010-03-06 Thread Sunny Srivastava
Dear R-Helpers, I have a short question related to heatmap.2 function. I wanted to change the dimension of each cell in the heatmap drawn by this function. here is a reproducible example from the help page library(gplots) data(mtcars) x <- as.matrix(mtcars) rc <- rainbow(nrow(x), start=0, end=.

Re: [R] Using apply function on duplicates in a data.frame

2010-01-31 Thread Sunny Srivastava
Thanks a lot. All the three approaches work for me! On Sun, Jan 31, 2010 at 10:43 PM, hadley wickham wrote: > On Sun, Jan 31, 2010 at 5:05 PM, Sunny Srivastava > wrote: > > Dear R-Helpers, > > I have a data.frame (df) and the head of data.frame looks like > > >

[R] Using apply function on duplicates in a data.frame

2010-01-31 Thread Sunny Srivastava
Dear R-Helpers, I have a data.frame (df) and the head of data.frame looks like ProbeUID ControlType ProbeName GeneName SystematicName 1665 1577 0 pSysX_50_22_1 pSysX_50 pSysX_50 5422 5147 0 pSysX_49_8_1 pSysX_49 pSysX_49 4042 3843 0 p

[R] Problems in installing MCMCglmm package

2009-12-20 Thread Sunny Srivastava
Dear R-Helpers, I am having troubles with installing with MCMCglmm package and I get the following error with a package "Matrix" Warning in library(pkg, character.only = TRUE, logical.return = TRUE, lib.loc = lib.loc) : there is no package called 'Matrix' Error: package 'Matrix' could not be loa

[R] Lattice : Help with changing the labels of x-axis in respective panels

2009-12-03 Thread Sunny Srivastava
Dear R-Helpers, I am not very experienced in using lattice and I am still in the learning stage I have a data set which looks like this: (I have deleted a few lines in order to save space) Chromosome marker Marker.Name Distance 1 1 1 PeMm261 0. 2 1 2

[R] Akaike weight in R

2009-11-10 Thread Sunny
I am using lm simulation in R and try to find the AICc and Akaike weight of the model. I searched out that using package "AICcmodavg" AICc is easily to get. I wonder how can I get the "Akaike weight", any function I can use to generate it? Thanks in advance. Sunny

Re: [R] a bug with Student t-value??

2009-11-07 Thread Sunny Srivastava
Hi Huaru, Are you sure you are looking at 0.95 and NOT 0.975? as qt(0.975,9) = 2.262 generally tables are given for alpha/2 (alpha=0.05 in your case) significance. Please check carefully. Thx, S. On Sat, Nov 7, 2009 at 4:02 AM, huaru wang wrote: > Hello, every one, > > Using the qt() functio

[R] Plot with CART results

2009-10-08 Thread Sunny
dea what gramma should I use? Thanks in advance. Sunny [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.h

[R] how to read point shp file to R?

2009-07-07 Thread Sunny
I am new with R and want do some analysis with a point vector data file. Any help is appreciate. Sunny [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the

[R] plotting ROC from coefficient in the model

2009-06-23 Thread sunny vic
Hi everyone. Probably this is statistical question rather than an R, but it involves packages from R I am asking here since I am unable to find an answer. In the parametric modeling packages like glmnet, lasso etc..., we are able to obtain the coeffcients that have entered the model. for e

[R] caret package

2009-06-08 Thread sunny vic
Hi all I am using the caret package and having difficulty in obtaining the results using regression, I used the glmnet to model and trying to get the coefficients and the model parameters I am trying to use the extractPrediction to obtain a confusion matrix and it seems to be giving me errors.