Displaying 20 results from an estimated 300 matches similar to: "summarizing a complex dataframe"
2007 Jul 20
1
Column-mean-values for targeted rows
Hi all,
I'm handling massive data.frames and matrices in R (30000 x 400).
In the 1st column, say, I have 0s and 1s indicating rows that matter; other columns have probability values.
One simple task I would like to do would be to get the column mean values for signaled rows (the ones with 1)
As a very fresh "programmer" I have build a simple function in R which should not be very
2013 Feb 15
0
Ho w Do I Get Cox Model Convergence After Multiple Imputation
Due to missing data with some of my predictor variables I first do multiple
imputation as follows:
library(foreign)
library(Amelia)
library(norm)
set.seed(666)
M=10
impdat <-
2007 Jan 19
2
combn implementation
Hi,
I was checking the source code to the function combn that "generates
all combinations of the elements of 'x' taken 'm' at a time.",
because I wished to modify it. I have a doubt about a statement.
This is the main loop.
._1 <- 1:1
nmmp1 <- n - m + ._1
while (a[1] != nmmp1) {
if (e < n - h) {
h <- ._1
e <-
2005 Aug 04
0
visualizing/summarizing a large, sparse logistic regression
I have data on ~340000 cases where it is desired to predict
binary outcome, Withdrawn, using up to 8, A:H, predictors in
a 3 x 2^7 design, but where the frequencies in these 168
cells vary enormously (1--108000). As well, there are
two additional variables, Agency and Office, and it is
desired, among other things, to determine if the rates
vary with Agency and Office controlling for A - H.
I fit
2005 Apr 26
1
Summarizing factor data in table?
I have a very simple query with regard to summarizing the number of factors
present in a certain snippet of a data frame.
Given the following data frame:
foo <- data.frame(yr = c(rep(1998,4), rep(1999,4), rep(2000,2)), div =
factor(c(rep(NA,4),"A","B","C","D","A","C")),
org = factor(c(1:4,1:4,1,2)))
I want to get
2010 Oct 23
1
Summarizing For Values with Multiple categories
Hi all,
I have some data as follows.
Cat1 Cat2 Cat3 COG Counts
A B C COG1 10
B D COG2 20
C COG3 30
D COG4 40
I would like to sum all the counts for each category:
A B C D
10 30 40 60
>CAT2COG<-
2011 Feb 11
0
Summarizing a response variable based on an irregular time period
Hello,
I have a question about working with dates in R. I would like to summarize a
response variable based on a designated and irregular time period. The
purpose of this is to compare the summarized values (which were sampled
daily) to another variable that was sampled less frequently. Below is a
trivial example where I would like to summarize the response variable dat$x
such that I have average
2008 Jun 03
0
Summarizing dummy coefficients in sem package
Greetings,
I am working in the sem package on a model with 3 exogenous variables (2
are nominal-categorical), and 4 endogenous, continuous variables. To
use sem with the nominal variables, I created dummy variables. Now, in
my sem output I have estimates for path coefficients for the
relationship between each level of the nominal variables and the
endogenous variables they are associated
2011 Dec 01
2
Summarizing elements of a list
Hi everyone,
I looked around the list for a while but couldn't find a solution to my
problem. I am storing some results to a simulation in a list and for each
element i have two separate vectors(is that what they are called, correct my
vocab if necessary). See below
Version1_<-list()
for(i in 1:5){
Version1_[[i]]<-list(First=rnorm(1),Second=rnorm(1))
}
What I want is to put all
2003 Jan 13
2
summarizing dataframe
Hi Listers,
Surely, I just have a mental block and there is a more elegant way of
creating a summary count (other than extracing it from ftable). I''d like to
create a new data.frame containing counts of spell by loc ie have three
columns showing spell,loc,count. Below the data.frame...
Any help appreciated
Thanks Herry
spell loc
101 Parts 1
102 Overall 2
105 Parts 1
106
2010 Dec 02
5
Help summarizing R data frame
I am trying to aggregate data in column 2 to identifiers in col 1
eg..
take this>
identifier quantity
1 10
1 20
2 30
1 15
2 10
3 20
and make this>
identifier quantity
1 45
2 40
3 20
Thanks in
2011 Apr 05
2
Precision of summary() when summarizing variables in a data frame
Hi,
I summary() a variable with 409908 numeric observations. The variable is
part of a data.frame. The problem is that the min and max returned by
summary() do not equal the ones returned by min() and max(). Does anybody
know why that is?
> min(data$vc)
[1] 15452
> max(data$vc)
[1] 316148
> summary(data$vc)
Min. 1st Qu. Median Mean 3rd Qu. Max.
15450 21670 40980
2009 Mar 24
3
Summarizing each row into a frequency table
I have a matrix containing -1, 0, 1, however certain rows will not
have all 3 numbers. I have written some codes to compute the frequency
table of how many -1s, 0s, 1s per row, but it is very ugly and not
efficient if there are more than 3 numbers. Please suggest.
m <- rbind(sample(0:1, replace=T, 10), sample(-1:1, replace=T, 10))
m.table <- t(apply(m, 1, function(x) c(sum(x==-1, na.rm=T),
2008 Mar 04
2
summarizing replicates with multiple treatments
I have a dataframe with several different treatment variables, and
would like to calculate the mean and standard deviation of the
replicates for each day and treatment variable. It seems like it
should be easy, but I've only managed to do it for one treatment at a
time using subset and tapply. Here is an example dataset:
> `exampledata` <-
structure(list(day = c(1L, 1L, 1L, 1L, 1L,
2007 Jul 05
3
summarizing dataframe at variable/factor levels
All,
Is there an efficient way to apply say "mean" or "median" to a dataframe
according to say all combinations of two variables in the dataframe?
Below is a simple example and the outline of a "manual" solution that
will work but is not very efficient
(could also generalize this to a function). Searched the archives and
docs but didn't see anything close to
2008 Mar 02
1
summarizing matrix data
Hi everyone,
I'm sure this is simple, but I can't seem to figure this out.
Situation. 3 different groups of subjects each submit n X n matrices of
scores. What I want to do is aggregate each group of scores into a summary
n X n matrix. I need the result to be a matrix so that I can calculate a
dissimilarity structure on it. So I thought I would create a
multi-dimensional array and
2010 May 12
3
Summarizing counts by multiple factors
Hi,
An example data set is:
group level color
A 1 "blue"
A 1 "Red"
B 1 "blue"
B 2 "Red"
A 2 "Red"
B 2 "Red"
B 2 "blue"
B 2 "blue"
A 2 "blue"
A 2 "Red"
2013 Jan 22
2
Blind transfer behavior - Asterisk 1.8 and 10
Hi,
I want to check the status of a blind transfer (only sip endpoint)
between various phones. Transfer is working perfectly, using ## from
features.conf or using transfer key from phone, here SNOM320.
My problem is that if party to transfer to is busy, the transfer fail
and the call is ended. What I want to do is to return the call to the
party who originate the transfer.
I checked
2008 Feb 22
3
Simultaneously summarizing many models
Dear R users,
Let?s say I have 10 models, each named m1,m2,m3..., and I would like to summarize them automatically
and simultaneously - e.g., to extract parameter estimates later on from all models; how can I do that?
I have tried:
x=1:10 #this creates some example data
y=rnorm(10)
m1=lm(x~y)
m2=lm(x~1)
sum.lms=function(x)summary(paste("m",x,sep=""))
sum.lms(1:2)
but
2008 May 01
5
Changing text in view with variables
in my view:
<% if @main_singer_1 == @your_singer %>
<% if @main_drummer_1 == @your_drummer %>
i want to have this in a loop so i can change _1
How would I do this.
I have some idea but I am not sure.
[1..20].each do .....
and then replace _1 with each of the numbers
or if someone can show the code to do this.
number = "1"
<% if