similar to: Assigning cases to groupings based on the values of several variables

Displaying 20 results from an estimated 10000 matches similar to: "Assigning cases to groupings based on the values of several variables"

2011 Aug 31
1
formatting a 6 million row data set; creating a censoring variable
List, Consider the following data. gender mygroup id 1 F A 1 2 F B 2 3 F B 2 4 F B 2 5 F C 2 6 F C 2 7 F C 2 8 F D 2 9 F D 2 10 F D 2 11 F D 2 12 F D 2 13 F D 2 14 M A 3 15 M A 3 16 M A 3 17
2011 Aug 24
2
data manipulation and summaries with few million rows
I have a data set with about 6 million rows and 50 columns. It is a mixture of dates, factors, and numerics. What I am trying to accomplish can be seen with the following simplified data, which is given as dput output below. > head(myData) mydate gender mygroup id 1 2012-03-25 F A 1 2 2005-05-23 F B 2 3 2005-09-08 F B 2 4 2005-12-07 F B 2
2008 Oct 21
3
code works in R desktop but not iin RWeb - How do I modify to get it working in RWeb, please?
Hi, How are you? I have a quick question.... I have code that works perfectly with R desktop, but does not work with RWeb. Could you please tell me how to modify the code below so it will work with RWeb? #Read in txt file happyguys<-read.table("c:/test8.txt", header=TRUE, row.names=1) #Subset the txt file to only include certain values test<-subset(happyguys, GRADE == 7
2008 Apr 28
2
F values from a Repeated Measures aov
Hi Folks, I have repeated measures for data on association time (under 2 acoustic condtions) in male and female frogs as they grow to adulthood (6 timepoints). Thus, two within-subject variables (Acoustic Condition: 2 levels, Timepoint: 6 levels) and one between-subject variable (Sex:male or female). I am pretty sure my distributions depart from normality but I would first like to simply run a
2010 Jul 09
3
how to plot two histograms overlapped in the same plane coordinate
Dear R-help listers, I am new. I just want to get helps on how to plot two histograms overlapped in the same plane coordinate. What I did is very ugly. Could you please help me to improve it? I want to got a plot with semi- transparent overlapping region. And, I want to know how to specify the filled colors of the different histograms. I also prefer other solutions other than ggplot2. Many
2009 Sep 04
2
lrm in Design package--missing value where TRUE/FALSE needed
Hi, A error message arose while I was trying to fit a ordinal model with lrm() I am using R 2.8 with Design package. Here is a small set of mydata: RC RS Sex CovA CovB CovC CovD CovE 2 1 0 1 1 0 -0.005575280 2 2 1 0 1 0 1 -0.001959580 2 3 0 0 0 1 0 -0.004725880 2 0 0 0 1 0 0 -0.005504850 2 2 1 1 0 0 0 -0.003880170 1 2 1 0 0 1 0 -0.006074230 2 2 1 0 0 1 1 -0.003963920 2 2 1 0 0 1 0
2010 Nov 11
3
Evaluation puzzle
The survexp function can fail when called from another function. The "why" of this has me baffled, however. Here is a simple test case, using a very stripped down version of survexp: survexp.test <- function(formula, data, weights, subset, na.action, rmap, times, cohort=TRUE, conditional=FALSE, ratetable=survexp.us, scale=1, npoints, se.fit,
2008 Oct 23
1
code works in R desktop but not iin RWeb - I got it working
Hi, I got this working. i had to get rid of an underscore in one of my variable names to work on RWeb. Thanks for your help though!! Natalie __________________ I think you have to be either honest or careful, since the code you submitted to Rweb is different with your former code! Why the condition was changed from "test<-subset(X, GRADE == 7 & Y_Q10A < 9)" to
2010 Apr 16
4
score counts in an aggregate function
Dear R-Users, I have a big data set "mydata" with repeated observation and some missing values. It looks like the format below: userid sex item score1 score2 1 0 1 1 1 1 0 2 0 1 1 0 3 NA 1 1 0 4 1 0 2 1 1 0 1 2 1 2 NA 1 2 1 3 1
2013 Jan 10
1
Semi Parametric Bootstrap
Greetings to you all, I am performing a semi parametric bootstrap in R on a Gamma Distributed data and a Binomial distributed data. The main challenge am facing is the fact that the residual variance depends on the mean (if I am correct). I strongly feel that the script below may be wrong due to mean-variance relationship #####R code####### fit1s
2004 Dec 30
1
subsetting within a function
hi I am trying to write a function around a glm or similar function, in which I can pass the subsetting constraint as an argument to the function, but I am having trouble. the following commands (if I wanted SEX==0 to be my subset) in the global environment work fine: subexpr <- expression(SEX==0) subtest <- with(mydata, eval(subexpr)) test.glm <- glm(y~x1+x2, data=mydata,
2001 Sep 12
1
error in nlme
I'm getting an error from nlme that has me stymied. I have a data set ,'mydata', with variables: AChE, Dose, sex, set, and mrid; 'set' and 'mrid' indicate two levels of nesting, with 'set' nested within 'mrid'. I want to fit the model: mod <- nlme(AChE ~ Cexp(Dose, A, B, m), data=mydata, fixed = A+B+M~sex, random=A+B+m~sex | mrid/set,
2008 Jun 15
1
multilevel basic lme question
Hi R users I want to use the lme package for a multilevel analysis on the following example: > math<-c(2, 3,2, 5, 6 ,7 , 7) > sex<-c(1, 2, 1, 2, 2, 2, 1) > school_A<-c(1,1,1,2,2,2,2) > school_B<-c(10,10,10,20,20,20,20) > mydata<-data.frame(math, sex, school_A, school_B) > mydata School_A and school_B are two different school characteristics, math is an
2009 Sep 18
1
Within-group correlation confidence intervals
I'm trying to obtain within-group correlations on a subset of variables. I first selected my variables using the following command: mydata$x<-mydata[c("iq","education","achievement")] I'd like to look at correlations among those variables separately for men and women. My gender variable in mydata is coded 1 (women) and 0 (men). I have successfully used
2013 Feb 18
2
How to label percentage values inside stacked bar plot using R-base
Hello, I am new to R. I would like others to explain to me how to add absolute values inside the individual stacked bars in a consistent way using the basic R plotting function (R base). I tried to plot a stacked bar graph using R base but the values appear in an inconsistent/illogical way in such a way that its supposed to be 100% for each village but they don't sum up to 100%. Here is the
2010 Jul 31
3
a problem
dear: when I read a Excel file(exp-11),The R project give me a error ,Just like this: ??'datafile' > write.foreign("exp-11.xls") ???list(df = df, datafile = datafile, codefile = codefile) : ??'datafile' > write.foreign("exp-11.xls") ???list(df = df, datafile = datafile, codefile = codefile) : ??'datafile' >
2003 Dec 14
3
Problem with data conversion
Hi All: I came across the following problem while working with a dataset, and wondered if there could be a solution I sought here. My dataset consists of information on 402 individuals with the followng five variables (age,sex, status = a binary variable with levels "case" or "control", mma, dma). During data check, I found that in the raw data, the data entry
2011 Apr 04
2
merging 2 frames while keeping all the entries from the "reference" frame
Hello! I have my data frame "mydata" (below) and data frame "reference" - that contains all the dates I would like to be present in the final data frame. I am trying to merge them so that the the result data frame contains all 8 dates in both subgroups (i.e., Group1 should have 8 rows and Group2 too). But when I merge it it's not coming out this way. Any hint would be
2009 Jan 19
1
further notes on model.frame issue
This is a follow-up on my note of Saturday. Let me start with two important clarifications - I think this would be a nice addition, but I've had exactly one use for it in the 15+ years of developing the survival package. - I have a work around for the current case. Prioritize accordingly. The ideal would be to change survexp as follows: fit <- survexp( ~ gender,
2012 Jan 19
2
Reading in tab (and space) delimited data within a script XXXX
Hello everyone, I use Bob Muenchen's approach for reading in "in-stream" (to use SAS parlance) delimited data within a script. This works great: mystring <- "id,workshop,gender,q1,q2,q3,q4 1,1,f,1,1,5,1 2,2,f,2,1,4,1 3,1,f,2,2,4,3 4,2, ,3,1, ,3 5,1,m,4,5,2,4 6,2,m,5,4,5,5 7,1,m,5,3,4,4 8,2,m,4,5,5,5" mydata <- read.table( textConnection(mystring),