similar to: How to apply a function to subsets of a data frame *and* obtain a data frame again?

Displaying 20 results from an estimated 5000 matches similar to: "How to apply a function to subsets of a data frame *and* obtain a data frame again?"

2009 Sep 20
2
missing level of a nested factor results in an NA in lm output
Hello All, I have posted to this list before regarding the same issue so I apologize for the multiple e-mails. I am still struggling with this issue so I thought I'd give it another try. This time I have included reproducible code and a subset of the data I am analyzing. I am running an ANOVA with three factors: GROUP (5 levels), FEATURE (2 levels), and PATIENT (2 levels), where
2011 Apr 30
1
More flexible aggregate / eval
Dear list, I would like to do some calculation using different grouping variables. My 'df' looks like this: # Some data set.seed(345) id <- seq(200,400, by=10) ids <- sample(substr(id,1,1)) group1 <- rep(1:3, each=7) group2 <- rep(1:2, c(10,11)) group3 <- rep(1:4, c(5,5,5,6)) df <- data.frame(id, ids, group1, group2, group3) df <- rbind(df, df, df) df$time <-
2005 Jan 27
3
clustering
Hi, I just get a question (sorry if it is a dumb one) and I "phase" my question in the following R codes: group1<-rnorm(n=50, mean=0, sd=1) group2<-rnorm(n=20, mean=1, sd=1.5) group3<-c(group1,group2) Now, if I am given a dataset from group3, what method (discriminant analysis, clustering, maybe) is the best to cluster them by using R. The known info includes: 2 clusters,
2005 Jun 24
1
lme4 extracting individual variance components
Hi, For further calculations I need to extract indivdual Variances of different random effects from a fitted model. I found out how to extract the correlations (VarCorr(m1)@reSumry$group1) but I was not able to find a way to extract the other components individually. To extract the Residuals I tried: (ranef(m1)@ stdErr) which unfortunately did not work. Thank you very much for your help!
2007 Oct 30
2
flexible processing
Hello, unfortunately, I don't know a better subject. I would like to be very flexible in how to process my data. Assume the following dataset: par1 <- seq(0,1,length.out = 100) par2 <- seq(1,100) fac1 <- factor(rep(c("group1", "group2"), each = 50)) fac2 <- factor(rep(c("group3", "group4", "group5", "group6"), each =
2009 Aug 28
1
how to explain the interaction terms regarding "treatment contrast" of lm model
Dear list, I am confused on how to explain the interaction term in the context of "treatment contrast". for example, I have an data frame as below: sub group val 1 a group1 3.685625 2 a group1 3.407445 3 a group1 4.040920 4 a group1 2.890875 5 b group1 3.853280 6 b group1 4.113585 7 b group1 3.043250 8 b group1 3.800920 9 c group1 5.394305 10 c
2008 May 11
1
positioning of color key in levelplot
Is there a way of positioning the color key in levelplot when the axes are on a categorical (rather than numerical) scale? I've put some sample code below. I need to add a secondary y axis to the right side of my plot but then the labels interfere with the color key (which is currently on the right side). Is there a way to shift the color key over a bit more to the right? I've tried
2016 Mar 31
4
rsync with overlay tree
I maintain a directory structure containing dirs and files that I regularly push to ~50 hosts, which are divided into 3 groups that have slightly different needs (minor mods in a couple of files). So ideally I would have 4 directories: /path/to/sync/common/ <- common files /path/to/sync/group1/ <- group1 specific only /path/to/sync/group2/ <- group2 specific only
2011 Apr 05
3
MSDFS - Can you hide folders with no access
Hello, i got a msdfs share running and now i want to hide folders from users who got no access to them anyway. For example: List of shares: test1 test2 User sees only: test1 Is something like that possible mit samba itself or does someone know a workaround to get it running like that ? Thanks for any ideas. A.Dura
2007 Jul 19
3
Can I test if there are statistical significance between different rows in R*C table?
Dear friends, My R*C table is as follow: better good bad Goup1 16 71 37 Group2 0 4 61 Group3 1 6 57 Can I test if there are statistical significant between Group1 and Group2, Group2 and Group3, Group1 and Group2, taking into the multiple comparisons? The table can be set up using the following program: a<-matrix(data=c(16,71,37,0,4,61,1,6,57),nrow=3,byrow=TRUE) Thanks
2012 Aug 21
2
Iterative sampling with restrictions
Hi all, I'm working on a seemingly trivial problem that I can't figure out how to implement in R. I'd be most grateful for any help here. I want to do the following: first, randomly assign each of n units to one of g groups of size n/g. Then, randomly re-assign each of the n units to a different group (i.e., same as the first step, but the unit can't be assigned to a group to
2011 Jul 06
1
How to compare ratio from multiple groups?
If I have 3 groups,and for each group,I get the ratio(e.g. incidence rate). Now I wanna compare 3 ratio pairwise,and get the corresponding p values,i.e: group1 vs group2 ,p value=? group1 vs group3 ,p value=? group2 vs group3 ,p value=? Which statistical test should be used? Thanks a lot for your help. [[alternative HTML version deleted]]
2008 Nov 24
1
No write permission if POSIX bits 0 on ZFS written by M$ Office - dos_mode returning r
Hi all, I'd appreciate any pointers or advise regarding the following issue with files written by M$ Office on Samba 3.0.32 on snv_98 (OpenSolaris) on a ZFS filesystem: samba share: [sharename] read only = No browseable = yes writeable = yes directory mask = 0770 create mask = 0770 delete readonly = Yes acl check permissions =
2012 Mar 07
2
staging shutdowns
Hello All, I'm deploying NUT in a data center and I'm curious to know how others have gone about staging the shutdown of various systems. The systems are broken down into groups of importance, group1 being the most important group4 being the least. In the event of an outage take down group4 after 5 minutes, group3 after 10 minutes, group2 after 15, and finally group4 after 20. I've
2010 Nov 11
1
exploratory analysis of large categorical datasets
Dear List, I am looking to perform exploratory analyses of two (relatively) large datasets of categorical data. The first one is a binary 80x100 matrix, in the form: matrix(sample(c(0,1),25,replace=TRUE), nrow = 5, ncol=5, dimnames = list(c( "group1", "group2","group3", "group4","group5"), c("V.1", "V.2", "V.3",
2012 May 22
2
getting a Likert plot from a data frame
I'm creating a stacked bar chart using the likert command in the HH package. My data are in a data frame, with two numeric variables and a categorical variable, I can't get likert to use the column containing the categorical variable as a my y axis label. Here is a quick example: library(HH) #my data are:
2007 Feb 14
2
Solaris 10 and "store dos attributes"
I'm having trouble with files being marked read-only in Windows because the Solaris file owner does not have write-permissions on the file; group-write is allowed: -r--rw---- 1 user group 32 Feb 13 14:19 testfile.txt I thought that setting "store dos attributes = yes" for this share would allow the "read only" setting to be stored in extended attributes, but it
2004 May 23
1
A (maybe)_ easy solution to global login script for group checking
Hello While searching the archives and googling for : -login script to map drives according to group membership I saw lots of complicated solutions (on-the-fly scripts, group directories) etc. but the following works very well for me: I downloade dthe ifmember.exe from the microsoft website, and stuck it in the netlogon directory (not the scripts directory)
2008 Jul 07
1
GLM, LMER, GEE interpretation
Hi, my dependent variable is a proportion ("prob.bind"), and the independent variables are factors for group membership ("group") and a covariate ("capacity"). I am interested in the effects of group, capacity, and their interaction. Each subject is observed on all (4) levels of capacity (I use capacity as a covariate because the effect of this variable is normatively
2010 Jul 06
3
Help With ANOVA (corrected please ignore last email)
Sorry i had a misprint in the appendix code in the last email Hi I needed some help with ANOVA I have a problem with My ANOVA analysis. I have a dataset with a known ANOVA p-value, however I can not seem to re-create it in R. I have created a list (zzzanova) which contains 1)Intensity Values 2)Group Number (6 Different Groups) 3)Sample Number (54 different samples) this is created by the