similar to: Selecting subset of factor levels

Displaying 20 results from an estimated 10000 matches similar to: "Selecting subset of factor levels"

2011 Jul 18
1
Multiple comparison test on selected contrasts
Dear Help-list, How can I do a multiple comparison test (mct) on selected contrasts from a linear model while using packages lme4 and multcomp? I am running R 2.13.0 under Windows 7. The following linear model and mct produces a global mct of 15 paired contrasts of the combined (Site, Position) factor SitePos of which only 9 are of interest. Model.G = lmer(log10(SrCa) ~ SitePos + (1 | Eel),
2011 Jul 16
1
Creating composite factor and changing format from character to factor
Dear Help-list, I have a dataframe containing 6 variables, 4 of which are factors, 2 numeric. I want to create another factor variable (SitePos) by combining 2 existing factors (Site and Position). I have tried a number of approaches based on trolling the R FAQs, various R webpages, etc., none of which work. One approach e.g. Data1$SitePos <- paste(Data1$Site, Data1$Position) creates the
2012 Jun 08
2
help with rle function on paired data
Dear R Community - I hope you might be able to provide some guidance regarding the use of the rle function. I have a set of time-series data where a measured value is recorded every 30 seconds after the start of an experiment. Many of the measured values repeat and I am interested only in the values when there is a change. If I turn the measured values into a vector, the rle function works
2011 Sep 06
1
Update packages problem
R-help, I recently updated R from 2.13.0 to 2.13.1 (32-bit Windows version) and now have a problem updating packages. I am running Windows 7 as operating system. As the FAQ suggests, I uninstalled 2.13.0 before installing 2.13.1. On first opening R, I ran "update.packages(checkBuilt=TRUE, ask=FALSE) ras also recommended and selected the NS Cran mirror. On doing this the following error
2011 Sep 23
2
LDA cutoff value
Hello, I have run a linear discriminant analysis for the simple 2 group case using the MASS package lda() function. With priors fixed at 0.5 and unequal n for each group, the output basically provides the group means and the LD1 value. There is no automatic output of the cutoff (decision boundary) value used to classify values of the response variable into the different groups. I have tried
2011 Aug 14
1
Renaming levels of a factor in a dataframe
Dear Helplist: I am trying, unsuccessfully, to rename levels of a factor in a dataframe. The dataframe consists of two factor variables and one numeric variable as follows: Factor Site has 2 levels AB and DE, factor Fish has 30 levels, 15 associated with each Site e.g. 1-1, 1-2,.....2-1, 2-2.... I am trying to rename the levels of factor Site from AB to Fw and DE to Est while keeping them as
2011 Aug 08
1
Help on reshape2 data frame rearrangement
Dear help list: I am trying to reshape a data frame from long to wide format and with a reduced variable list using reshape2. The original data frame format is: Site Obs_no LengthSite 1 Obs 1 10Site 1 Obs 2 13Site 1 Obs 3 14.........Site 2 Obs 1 5Site 2 Obs 2 7Site 2 Obs 3 9 Site and Obs_no are factors and Length is a numeric variable. There are 15
2007 Oct 15
18
Merbivore.com - Mockups
There''s been some discussion on the IRC channel about getting a site for Merb going. Since the culture around the project is pretty casual, I figured I''d just throw a few ideas together, see what you guys think. So, firstly here are three example pages, just to show off the general look and feel. http://mr-eel.com/tmp/merb/01_frontpage.gif
2018 Jan 08
3
Replace NAs in split lists
Why do you want to modify df1? Why not just reassemble the parts as a new data frame and use that going forward in your calculations? That is generally the preferred approach in R so you can re-do your calculations easily if you find a mistake later. -- Sent from my phone. Please excuse my brevity. On January 7, 2018 7:35:59 PM PST, Ek Esawi <esawiek at gmail.com> wrote: >I just came
2018 Jan 08
2
Replace NAs in split lists
Thank you Jeff. Your code works, as usual , perfectly. I am just wondering why if i put the whole code in one line, i get an error message. sdf2 <- lapply( sdf, function(z){z$Value <-ifelse(is.na(z$Value),z$Value[!is.na(z$Value)][1],z$Value)z}) error. unexpected symbol in sdf2 Thanks again EK On Mon, Jan 8, 2018 at 3:12 AM, Jeff Newmiller <jdnewmil at dcn.davis.ca.us> wrote: >
2018 Jan 08
0
Replace NAs in split lists
Upon closer examination I see that you are not using the split version of df1 as I usually would, so here is a reproducible example: #---- df1 <- read.table( text= "ID ID_2 Firist Value 1 a aa TRUE 2 2 a ab FALSE NA 3 a ac FALSE NA 4 b aa TRUE 5 5 b ab FALSE NA ", header=TRUE, as.is=TRUE ) sdf <- split( df1, df1$ID ) # note the extra [ 1 ]
2009 Mar 21
0
object gstat
dear all i have this dataset: x,y, datavalue > dati[,c(1,2,5)] [,1] [, 2] [,3] [1,] 2.386 3.077 1.740 [2,] 2.544 1.972 1.335 [3,] 2.807 3.347 1.610 [4,] 4.308 1.933 2.150 [5,] 4.383 1.081 1.565 [6,] 3.244 4.519 1.145 [7,] 3.925 3.785 0.894 [8,] 2.116 3.498 0.525 [9,] 1.842 0.989 0.240 [10,] 1.709 1.843 0.625 [11,] 3.800 4.578 3.873 [12,] 2.699 1.199 1.425
2018 Jan 08
0
Replace NAs in split lists
I don't know. You seem to be posting in HTML so your code is mangled. Can you post plain text and use the reprex package to make sure it produces the errorin a clean R session? -- Sent from my phone. Please excuse my brevity. On January 8, 2018 8:03:45 AM PST, Ek Esawi <esawiek at gmail.com> wrote: >Thank you Jeff. Your code works, as usual , perfectly. I am just >wondering why
2018 Jan 08
2
Replace NAs in split lists
Hi With the example, na.locf seems to be the easiest way. > library(zoo) > na.locf(df1) ID ID_2 Firist Value 1 a aa TRUE 2 2 a ab FALSE 2 3 a ac FALSE 2 4 b aa TRUE 5 5 b ab FALSE 5 Cheers Petr > -----Original Message----- > From: R-help [mailto:r-help-bounces at r-project.org] On Behalf Of Jeff > Newmiller > Sent: Monday, January
2018 Jan 08
1
Replace NAs in split lists
OPS! Sorry i did indeed posted the code in HTML; should have known better. ifelse(is.na(z$Value),z$Value[!is.na(z$Value)][1],z$Value)z}) error. unexpected symbol in sdf2 On Mon, Jan 8, 2018 at 11:44 AM, Jeff Newmiller <jdnewmil at dcn.davis.ca.us> wrote: > I don't know. You seem to be posting in HTML so your code is mangled. Can you post plain text and use the reprex package to
2018 Jan 08
2
Replace NAs in split lists
You can enforce these assumptions by sorting on multiple columns, which leads to na.locf(df1[ order(df1$ID,df1$Value), ]) On Mon, Jan 8, 2018 at 4:19 PM, Jeff Newmiller <jdnewmil at dcn.davis.ca.us> wrote: > Yes, you are right if the IDs are always sequentially-adjacent and the > first non-NA value appears in the first record for each ID. > -- > Sent from my phone. Please
2006 Feb 15
2
Pairwise comparison after repeated measures ANOVA
I am analyzing some data obtained after measuring some parameters at different times in samples obtained from many subjects. The model is quite simple: aov(parameter ~ Time + Error(Subject/Time)) Now I want to make a pairwise comparison between the levels of Time. However, I have not find how to do such a thing. I cannot use TukeyHSD or pairwise.t.test, I supposse. Maybe using contrasts? Could
2008 Apr 15
4
InvalidAuthenticityToken exception when deleting cookies
Hello, I''ve been testing my project with some manual tests. One of them consists of deleting cookies ("clean personal info" in firefox) just before submit the login form. Then, I get an error. The error message is: ActionController::InvalidAuthenticityToken in SessionsController#create I''m on Rails 2.0.2 with restful_authentication plugin. I''m using
2018 Jan 08
0
Replace NAs in split lists
Yes, you are right if the IDs are always sequentially-adjacent and the first non-NA value appears in the first record for each ID. -- Sent from my phone. Please excuse my brevity. On January 8, 2018 2:29:40 AM PST, PIKAL Petr <petr.pikal at precheza.cz> wrote: >Hi > >With the example, na.locf seems to be the easiest way. >> library(zoo) > >> na.locf(df1) > ID
2018 Jul 10
2
Is it really valid to discard externally instantiated functions from a TU when marked inline?
Hi, While investigating the situation of visibility annotations and linkage in libc++ with the goal of removing uses of `__always_inline__`, Eric Fiselier and I stumbled upon the attached test case, which I don't think Clang compiles properly. Here's the gist of the test case, reduced to the important parts (see the attachment if you want to repro): // RUN: %cxx -shared -o