similar to: weight median by count for multiple records

Displaying 20 results from an estimated 1000 matches similar to: "weight median by count for multiple records"

2007 Aug 22
2
Need a variant of rbind for datasets with different numbers of columns
Hello. I am looking for a function that will allow me to paste rows together without regard for the numbers of columns in the datasets to be joined. The only columns where it matters if they are aligned correctly are at the beginning - the rest of the columns represent differing numbers of ICD9 (disease) codes reported by each person(record) at a health visit. They are in no particular order.
2007 Jul 30
1
simple coding question
I have a list of ICD9 (disease) codes with various formats - 3 digit, 4 digit, 5 digit. The first three digits of these codes are what I am most interested in. I would like to either add zeros to the 3 and 4 digit codes to make them 5 digit codes or add decimal points to put them all in the format ###.##. I did not see a function that allows me to do this in the formatting command. This seems
2007 Aug 27
1
subset question
I would like to code records in a dataset with a 1 if any of the columns 9-67 contain a particular code, and zero if they don't. I've been working with "subset" and it seems that something like subset(data, data[9:67]--"12345") would work, but I have been unsuccessful so far. It seems like a simple problem - any help is appreciated!
2009 Aug 26
1
Within factor & random factor
Hi, I am quite new to R and trying to analyze the following data. I have 28 controls and 25 patients. I measured X values of 4 different locations (A,B,C,D) in the brain image of each subject. And X ranges from 0 to 1. I think "control or patient" is a between subject factor and location is a within subject factor. So, controls: 28 patients: 25 (unbalanced data set) respone measure:
2009 Apr 24
2
Array
Hi there, Just wondering if anyone has any tips for using arrays? I am trying to convert the following SAS code to R: data A2; set A1; by subject_id; retain BX1-BX10 i; array b(1:10) BX1-BX10 ; if first.subject_id then do ; do j=1 to 10; b(j) = .; end; i=1; end; b(i) = BX; i = i+1; if last.subject_id then
2007 Jun 28
2
sampling question
I am interested in locating a script to implement a sampling scheme that would basically make it more likely that a particular observation is chosen based on a weight associated with the observation. I am trying to select a sample of ~30 census blocks from each ZIP code area based on the proportion of women in a ZCTA living in a particular block. I want to make it more likely that a block will
2003 Sep 16
2
gnls( ) question
Last week (Wed 9/10/2003, "regression questions") I posted a question regarding the use of gnls( ) and its dissimilarity to the syntax that nls( ) will accept. No one replied, so I partly answered my own question by constructing indicator variables for use in gnls( ). The code I used to construct the indicators is at the end of this email. I do have a nagging, unanswered
2010 Dec 06
1
lattice: strip panel function question
Dear list, If have some repeated measurement data which looks something like: time <- rep(1:5 , each=2*4) groups <- rep(c("Case", "Control"), each=4) subjects <- factor(rep(1:(2*4), 5)) responses <- time + rnorm(5*2*4) + as.integer(factor(groups)) data <- data.frame(responses, time, groups, subjects) Now I want to plot each subject in a separate panel:
2009 Apr 22
1
Count Code
Hi there, I am interested in converting SAS code to R & I wondered if anyone had any quick R code/tips for the following piece of test SAS code? Any feedback greatly appreciated. data A1; set A1; count + 1; by subject_id; if first.subject_id then count = 1; run; [[alternative HTML version deleted]]
2009 Jan 25
1
Multiple lattice plots on a page: aligning x-axes vertically
Dear R-help, I am creating a two lattice plots (a densityplot() and xyplot()) that have the same x-axes and then 'printing' them onto the same page, one above the other (see end of email for an example to generate the graph). With different labels on the y-axis for each plot the left spacing is different, and the x-axes don't align vertically. Although I can manually modify the
2009 Jan 27
1
Creating list or numeric vectors out of selected columns of row oriented data
I am just assuming this can be done, but I have not gotten close to making it happen. I have a data file with about 1 million rows with 1470 unique subjects. Each row represents a small set of observations made on a specific date for a single subject. I would like to transform the data so that I have an R object with a single entry for each subject and start date and vectors for the
2016 Jun 22
2
Ayuda sencilla (SQL)
Muchas gracias, Carlos. Sobre todo por el sqldf, que seguro me ahorre mucho tiempo. La opción que se plante de primero d <- table(tips$day) y luego dim(d) me parece menos eficiente y cómo que directamente sqldf("select count(distinct day) from tips"), pero supongo que esos son gustos! También son "cómodas" las líneas: aggregate(subjectid ~ cond, data = dat, FUN = function(x)
2008 Nov 20
2
Calculating SD according to groups of rows
*Hi all, I know this is probably basic, but I have proven to be a slow learner in any programming language. Anyhow, how can I calculate the SD for each person in my table? I have two patients in this R data.frame, 7200 and 23955. I extracted this from a relational database, but am I better off attempting to compute SD in SQL, or is this easily accomplished in R? * SUBJECT_ID HR 1
2016 Jun 22
2
Ayuda sencilla (SQL)
Estoy en 3.3.0 y "sqldf" lo instala sin problemas... El 23 de junio de 2016, 1:23, Mauricio Monsalvo <m.monsalvo en gmail.com> escribió: > Malas nuevas para mi: > package ?sqldb? is not available (for R version 3.3.0) > ¿Puedo hacer algo más que esperar? No me voy a "bajar" de versión de R. > > El 22 de junio de 2016, 20:02, Mauricio Monsalvo
2009 Sep 23
2
collection_text onchange event
hi, I want to display a drop down list and when i select some option from the drop down list i want to display all the records under that selected category in the "SAME PAGE".. eg .. <%= collection_select(:question,:subject_id ,@subject, :id, :name) %> when i choose a subject i should, display all the questions under that subject in the same page.I am new to rails.Can
2008 Sep 08
2
How to preserve date format while aggregating
Hi I have a dataframe in which some subjects appear in more than one row. I want to extract the subject-rows which have the minimum date per subject. I tried the following aggregate function. attach(dataframe.xy) aggregate(Date,list(SubjectID),min) Unfortunately, the format of the Date-column changes to numeric, when I'm applying this function. How can I preserve the date format? Thanks
2009 Feb 18
1
multidimensional scaling with long form data
I have a dissimilarity dataset with the form: 1 1 dissimilarity value 1 2 ... 1 3 1 4 2 2 2 3 2 4 ... I would like to do nonmetric multidimensional scaling with this data, but I am having trouble using this format. I would like to either find a function that accepts this format or find a way to easily convert this format to a matrix for use with existing functions. Thanks!
2004 Mar 23
2
Coefficients and standard errors in lme
Hello, I have been searching for ways to obtain these for combinations of fixed factors and levels other than the 'baseline' group (contrasts coded all 0's) from a mixed-effects model in lme. I've modelled the continuous variable y as a function of a continuous covariate x, and fixed factors A, B, and C. The fixed factors have two levels each and I'd like to know whether
2009 Jan 14
3
multiple secondary axes
Dear R experts, I want to plot a line chart with another secondary axis placed right to the standard secondary axis which one can access with the axis command, so that the data lines are seen in the same plot. Is there any way to do this in R? Many thanks, Kirsten.
2008 Oct 31
1
replace() error: new columns would leave holes after existing columns
Hello, I have a problem with using replace() to convert a vector of dates from yyyy-mm-dd to julian date. For example, I type replace(x,2004-05-14,134) and I receive an error: Error in `[<-.data.frame`(`*tmp*`, list, value = 134) : new columns would leave holes after existing columns If I can successfully convert, I have a script that will convert all of the dates in