similar to: cut2 error

Displaying 20 results from an estimated 12000 matches similar to: "cut2 error"

2012 Oct 17
2
loop of quartile groups
Greetings R users, My goal is to generate quartile groups of each variable in my data set. I would like each experiment to have its designated group added as a subsequent column. I can accomplish this individually with the following code: brks <- with(data_variables, cut2(var2, g=4)) #I don't want the actual numbers, I need a numbered group data$test1=factor(brks,
2012 Dec 04
3
reformatting some data
Hello, I am trying to reformat some data so that it is organized by group in the columns. The data currently looks like this: group X3.Hydroxybutyrate X3.Hydroxyisovalerate ADP 347 4 4e-04 3e-04 5e-04 353 3 5e-04 3e-04 6e-04 359 4 4e-04 3e-04
2012 Oct 26
4
Merge matrices with different column names
A general question that I have been pursuing for some time but have set aside. When finishing some analysis, I can have multiple matrices that have specific column names. Ideally, I would like to combine these separate matrices for a final output as a csv file. A generic example: Matrix 1 var1A var1B var1C x x x x x
2012 Sep 28
3
Better way of Grouping?
Hello R users, This is more of a convenience question that I hope others might find useful if there is a better answer. I work with large datasets that requires multiple parsing stages for different analysis. For example, compare group 3 vs. group 4. A more complicated comparison would be time B in group 3 of group L with B in group 4 of group L. I normally subset each group with the
2011 Oct 11
1
warning with cut2 function
Dear r user, please find my attached sample of the dataset i? am using to create a crosstable and eventually plot a histogram from the output. I am using? the cut2 function to create bins, about 7 of them using the code after reading the data: cluster <- cut2(cross_val$value, g=7) I get the warning: Warning message: In min(xx[xx > upper]) : no non-missing arguments to min; returning Inf
2009 Oct 23
1
cut2 once, bin twice...
Hello, I'm using the Hmisc cut2 function to bin a set of data. It produces bins that I like with results like this: [96,270]:171 [69, 96): 54 [49, 69): 40 [35, 49): 28 [28, 35): 14 [24, 28): 8 (Other) : 48 I would like to take a second set of data, and assign it to bins based on factors defined by my call to cut 2. Does anyone know how I can do this? Thank you, -S -- View this message
2010 Mar 08
1
Help with Hmisc, cut2, split and quantile
Hello, I have a set of data with two columns: "Target" and "Actual". A http://n4.nabble.com/file/n1584647/Sample_table.txt Sample_table.txt is attached but the data looks like this: Actual Target -0.125 0.016124906 0.135 0.120799865 ... ... ... ... I want to be able to break the data into tables based on quantiles in the "Target" column. I can see (using
2013 Mar 02
2
caret pls model statistics
Greetings, I have been exploring the use of the caret package to conduct some plsda modeling. Previously, I have come across methods that result in a R2 and Q2 for the model. Using the 'iris' data set, I wanted to see if I could accomplish this with the caret package. I use the following code: library(caret) data(iris) #needed to convert to numeric in order to do regression #I
2012 Oct 18
1
looping survdiff?
Hello, I am trying to set up a loop that can run the survdiff function with the ultimate goal to generate a csv file with the p-values reported. However, whenever I try a loop I get an error such as "invalid type (list) for variable 'survival_data_variables[i]". This is a subset of my data: structure(list(time = c(1.51666666666667, 72, 72, 25.7833333333333, 72, 72, 72, 72, 72,
2012 May 25
3
count number of groups
Hello, Simple question that I am stuck on and can't seem to find an answer in the help files currently. I have a list which contains repeated ID's. I would like to have R count the number of ID's. For example: ID=c(1,1,1,1,2,2,2,2,3,3,3,3) as.data.frame(ID) Clearly, there are 3 groups. How would I have R give me the summary: ID 3 Many thanks, Charles [[alternative HTML
2012 Jul 01
2
list to dataframe conversion-testing for identical
HI R help, I was trying to get identical data frame from a list using two methods. #Suppose my list is: listdat1<-list(rnorm(10,20),rep(LETTERS[1:2],5),rep(1:5,2)) #Creating dataframe using cbind dat1<-data.frame(do.call("cbind",listdat1)) colnames(dat1)<-c("Var1","Var2","Var3") #Second dataframe conversion
2012 Dec 21
2
how to recode an ordered factor
Dear R helpers, I'm trying to recode an ordered factor to reverse its scale, but I can't figure out how to make it. I am using the Recode function provided by the Car package. I've created an ordered variable: data$o.var1 <- ordered(data$var1, levels=c(1,2,3,4), labels =c("very satisfied", "fairly satisfied", "not very satisfied", "not at all
2013 Jun 06
2
generating a bar chart with two axis for co-linear variable
Hello Dimitris, I was goggling for some help on Sensitivity vs 1-specificity and saw your link. I hope you can be of help to me in one of the issue that I am facing in generating combo chart(bar chart and plot). I am a novice and have some difficulty in getting this logic correct. I am give a dataset (I am attaching a sample dataset). I am using a barplot() and passing values for
2013 Mar 07
2
Multivariate Power Test?
Generic question... I am familiar with generic power calculations in R, however a lot of the data I primarily work with is multivariate. Is there any package/function that you would recommend to conduct such power analysis? Any recommendations would be appreciated. Thank you for your time, Charles [[alternative HTML version deleted]]
2013 Feb 01
2
Nested loop and output help
Hello Everyone, My name is Thomas and I have been using R for one week. I recently found your site and have been able to search the archives of posts. This has given me some great information that has allowed me to craft an initial design to an inquiry I would like to make into the breakdown of McNemar's test. I have read an intro to R manual and the posting guides and hope I am not violating
2013 Apr 18
6
count each answer category in each column
Hey, Is it possible that R can calculate each options under each column and return a summary table? Suppose I have a table like this: Gender Age Rate Female 0-10 Good Male 0-10 Good Female 11-20 Bad Male 11-20 Bad Male >20 N/A I want to have a summary table including the information that how many answers in each category, sth like this: X
2011 Jun 23
2
Merging multiple data sets
Hi, I am trying to merge data similar to the example data below > dat0 id var1 var2 var3 2 1 0 1 3 1 0 1 4 0 1 1 5 0 1 1 > dat1 id var4 var5 var6 2 1 0 1 3 1 0 1 6 0 1 1 7 0 1 1 > dat2 id
2009 May 20
1
sem with categorical data
I am trying to run a confirmatory factor analysis using the SEM package. My data are ordinal. I have read http://socserv.mcmaster.ca/jfox/Misc/sem/SEM-paper.pdf. When I apply the hetcor function, I receive the following error: Error in checkmvArgs(lower = lower, upper = upper, mean = mean, corr = corr, : at least one element of 'lower' is larger than 'upper' Example:
2004 Jul 06
3
Improving effeciency - better table()?
Hi, I've been running some simulations for a while and the performance of R has been great. However, I've recently changed the code to perform a sort of chi-square goodness-of-fit test. To get the observed values for each cell I've been using table() - specifically I've been using cut2 from Hmisc to divide up the range into a specified number of cells and then using
2013 Apr 24
1
matching observations and ranking
Hi, It is not that clear. If VAR1 is a match between columns AB001A, AB0002A, VAR2? between AB001A, AB362 and VAR3 between AB0002A and AB362: Also, I assume row8 match would be taken as 1. dat1<- read.table(text=" ? S.No AB001A AB0002A AB362 ?? 1?? -/-??????? C/C?? A/A??????????????????????? ??? 2?? C/C??????? C/C?? A/A??????????????????????? ??? 3?? C/C??????? C/C??