similar to: crosstabulation of means

Displaying 20 results from an estimated 300 matches similar to: "crosstabulation of means"

2016 Apr 02
3
apply mean function to a subset of data
Dear all; This must have a rather simple answer but haven't been able to figure it out: I have a data frame with say 2 groups (group 1 & 2). I want to select from group 1 say "n" rows and calculate the mean; then select "m" rows from group 2 and calculate the mean as well. So far I've been using a for loop for doing it but when it comes to a large data set is
2016 Apr 03
1
apply mean function to a subset of data
Here are several ways to get there, but your original loop is fine once it is corrected: > for (i in 1:2) smean[i] <- mean(toy$diam[toy$group==i][1:nsel[i]]) > smean [1] 0.271489 1.117015 Using sapply() to hide the loop: > smean <- sapply(1:2, function(x) mean((toy$diam[toy$group==x])[1:nsel[x]])) > smean [1] 0.271489 1.117015 Or use head() > smean <- sapply(1:2,
2016 Apr 02
0
apply mean function to a subset of data
Hi Pedro, This may not be much of an improvement, but it was a challenge. selvec<-as.vector(matrix(c(nsel,unlist(by(toy$diam,toy$group,length))-nsel), ncol=2,byrow=TRUE)) TFvec<-rep(c(TRUE,FALSE),length.out=length(selvec)) toynsel<-rep(TFvec,selvec) by(toy[toynsel,]$diam,toy[toynsel,]$group,mean) Jim On 4/3/16, Pedro Mardones <mardones.p at gmail.com> wrote: > Dear all; >
2006 Dec 03
2
Force "square" crosstabulation
Hello list members, I'm looking for a way to force the results of a crosstabulation to be square - that is, to include 0 values. For example: table(letters[1:4],letters[c(1:3,3)]) yields: a b c a 1 0 0 b 0 1 0 c 0 0 1 d 0 0 1 I would like to return: a b c d a 1 0 0 0 b 0 1 0 0 c 0 0 1 0 d 0 0 1 0 Any suggestions? Thanks! -- Manuel A. Morales
2009 Nov 16
2
Conditional statement
Dear useRs, I wrote a function that simulates a stochastic model in discrete time. The problem is that the stochastic parameters should not be negative and sometimes they happen to be. How can I conditionate it to when it draws a negative number, it transforms into zero in that time step? Here is the function: stochastic_prost <- function(Fmean, Fsd, Smean, Ssd, f, s, n, time, out=FALSE,
2008 Nov 13
2
CROSSTABULATION
I want to form a 3x3 crosstabulation for the signs of two vectors (i.e. Negative, Zero, Positive). The problem is that I am simulating the data so for some iterations one of the categories is absent. Thus the resulting table shrinks to 3x2. I want it to be 3x3 with zero column corresponding to the missing category. Moreover, I have tried but failed to give the dimension names. -- Sohail Chand
2009 Oct 12
1
crosstabulation and unlist function
Hello R-users, My toy example: aa<-c(1:5) bb<-c(NA,2,NA,4,5) cc<-c(1,2,NA,4,NA) dd<-c("A","B","B","A","C") df<-data.frame(aa,bb,cc,dd=as.factor(dd)) table(unlist(df[,1:3])) Can anyone point me to what function let's me do a crosstabulation between table(unlist(df[,1:3])) and df$dd? I want to find out when dd==A (or B,
2000 Sep 24
2
FW: Crosstabulation
how about this: tapply(vector,list(factor1,factor2),function)? -----Original Message----- From: owner-r-help at stat.math.ethz.ch [mailto:owner-r-help at stat.math.ethz.ch]On Behalf Of Murray Jorgensen Sent: 24. september 2000 02:46 To: R-help Subject: [R] Crosstabulation I can't seem to find a function in R similar to Splus crosstabs() for creating a multi-way table from factors and a
2001 Sep 06
0
crosstabulation
Hi, I find difficult to read crosstabulated data without percentages, so I wrote this dirty function that may be useful to others. It only works up to 3 dimensions since I am not very good at programming in R. I would appreciate if someone else has a better similar function or can improve this one. As an example of use: > x<-rbinom(100,1,.3) > y<-rbinom(100,1,.3) >
2004 Dec 03
1
Difficulty implementing "scales" in a lattice plot
Hello all, I am rather new to lattice and have a simple question regarding formatting text labels on the axes. I have looked through my own archive on lattice notes, searched and examined 30 or so hits on Dr. Baron's search site, looked through my MASS book, my Data Analysis and Graphics Using R book, R news articles, and I have in my hand the lattice package instructions and have read and
2006 Jun 14
4
could someone tell me how to implement a multiple comparison test for proportions in a 2xc crosstabulation
Dear all, I wanna to do multiple comparison test for proportions (multiple chi squre ?), could someone tell me how in R, thank you!
2006 Feb 08
1
Simple optim - question
Hello, I want to find the parameters mu and sigma that minimize the following function. It's important, that mu and sigma are strictly positive. ----------------- optimiere = function(fmean,smean,d,x,mu,sigma) { merk = c() for (i in 1:length(d)) merk=c(merk,1/(d[i]^2)*(d[i]-1/(fmean*(1-plnorm(x[i],mu,sigma))))^2) return(sum(merk)) } ----------------- To do that I'm using the nlm
2002 Sep 25
10
Reading complicated data file
Hi, I am new in R and I have problem with reading this data file 0 TITLE Title 0 XLEGEND Legend -1 LABEL x 1 1 12 1 2 30 1 3 34 I want to read only lines starting with 1 (it indicates 1st plotting line) and create data set from second and third value on this row. Thank for advice Jakub Zlamal -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list
2010 May 20
2
multiple 2 by 2 crosstabulations?
Hello, I have a dataframe (var_1, var_2, ..., var_n) and I would like to export summary statistics to Latex in the form of a table. I want specific summary statistics by crossing numerous variables 2x2 AT ONCE. In each cell I would like sometimes to have the median (Q1 - Q3), or frequency and proportion, etc. CrossTable, xtab, etc... do not allow for multiple 2 by 2 crosstabulation. The table
2006 Feb 08
2
When is update 3 coming out?
Hey dudes, Nice work by the CentOS team in giving us arguably the best distro in the world. When is update 3 coming out? What changes are expected in it? The reason i ask is that i applied the openoffice.org 2.0.1-1 rpms and now WINE is not playing so nicely. It may be a good time to re-wipe the system and reinstall update 3 from fresh ISO's. some of these "goodies" from upstream
2008 Feb 18
2
Custom Plot - means, SD & 5th-95th% (Plotmeans or Boxplot)?
Any help with this problem would be greatly appreciated: I need to produce a custom plot i haven't come across in R. Basically, I want to show means, 1st standard deviation and 5th and 95th percentiles visually, using something resembling a boxplot. Is it possible to completely customize a boxplot so that it shows means as the bar (instead of, not as well as medians), standard deviations at
2005 May 23
4
Broadvoice delivers CID even when restricted?
I can call my Broadvoice DID from a outbound caller-id blocked phone, and BV happily delivers the CID to Asterisk (and then on to my IP phone display.) I've tested with the *67 prefix from a PSTN phone to make sure it was supposed to be blocked. The number is always correct, but sometimes the the caller ID name is set to something funky (like a CO or switch center name.) I *think* this
2003 Jun 17
11
New Module app_perl
I just made my first 2 modules for asterisk (The 1st one is depriciated already). I was annoyed that i couldn't get GotoIf to take any expressions besides a boolean then i made a module to mimic gotoif and parse a few expressions like (${var} > 12) exten => 1,1,gotoif_expr,${var} > 12:1|4:1|5 Then I immediatly obseleted it with this new embedded perl module that lets you
2007 Apr 21
0
possible bug in xYplot and smean.cl.normal
I'm using R (2.4.1) and Hmisc (3.3-1), and I'd like to plot confidence intervals using xYplot and smean.cl.normal (or smean.cl.boot) from Hmisc. You can do that using the summarize() to produce a new data.frame and then plot with xYplot, or by specifying method=smean.cl.normal in the xYplot. Both produce very similar graphs in all trivial examples I've tried, but not in the attached
2014 Jun 03
8
[PATCH v2 0/4] Constant folding of new Instructions
And another try for constant folding of Instructions for nvc0. Please Review this! Thanks, Tobias Klausmann Tobias Klausmann (4): nvc0/ir: clear subop when folding constant expressions nvc0/ir: Handle reverse subop for OP_EXTBF when folding constant expressions nvc0/ir: Handle OP_BFIND when folding constant expressions nvc0/ir: Handle OP_POPCNT when folding constant expressions