search for: lev1

Displaying 13 results from an estimated 13 matches for "lev1".

Did you mean: lev
2008 Jan 02
3
Find missing days
...;)) date1 <- as.Date(seq(ISOdate(2007,9,1), ISOdate(2007,11,5), by=60*60*24)) date1 <- date1[-c(3,4,15,34,38,40)] df <- data.frame(lev=lev, date1=date1, y=y) I would like to produce a new data.frame with missing days in df$date1 in each df$lev, like this: lev date1 1 lev1 2007-09-03 2 lev1 2007-09-04 3 lev1 2007-09-15 4 lev2 2007-09-01 5 lev2 2007-09-02 etc. How can I do this? Thanks, Lauri FRCBS [[alternative HTML version deleted]]
2006 Feb 17
1
Transforming results of the summary function
Hi all, I have a question about transforming the data from summary function. Let's say I have a data frame like this: > x = data.frame(a = c(rep("lev1", 5), rep("lev2", 5)), b = c(rnorm(5)+2, rnorm(5))) > x a b 1 lev1 1.5964765 2 lev1 2.2945609 3 lev1 3.5285787 4 lev1 1.4439838 5 lev1 2.2948826 6 lev2 1.7063506 7 lev2 -0.4042742 8 lev2 -1.6485337 9 lev2 -1.1163817 10 lev2 -0.2023246 I'd like to...
2008 Oct 19
2
definition of "dffits"
....org Hi! R-users. I am just wondering what the definition of "dffits" in R language is. Let me show you an simple example. function() { library(MASS) xx <- c(1,2,3,4,5) yy <- c(1,3,4,2,4) data1 <- data.frame(x=xx, y=yy) lm.out <- lm(y~., data=data1, x=T) lev1 <- lm.influence(lm.out)$hat sig1 <- lm.influence(lm.out)$sigma res1 <- residuals(lm.out) ey <- fitted(lm.out) py <- ey + res1/(1-lev1) df1 <- dffits(lm.out, infl = lm.influence(lm.out)) df1 <- dffits(lm.out) print("df1: dffits") print(df1) my_df1...
2007 Aug 07
1
Naming Lists
Hi Im pretty new to R and I have run in to a problem. How do I name all the levels in this list. Lev1 <- c("A1","A2") Lev2 <- c("B1","B2") Lev3 <- c("C1","C2") MyList <- lapply(Lev1,function(x){ lapply(Lev2,function(y){ lapply(Lev3,function(z){ paste(unlist(x),unlist(y),unlist(z)) })})}) I would like to name the different lev...
2007 Aug 23
1
How to merge string to DF
...- paste(DF$g, DF$wdays) DF #Now I calculate group means tmp <- aggregate(DF$y, list(DF$x, DF$f), mean) tmp #After doing this, I want to merge string from DF$conc to tmp using DF$x and DF$y as an identifier #The following DF should look like this: Group.1 Group.2 x var1 1 1 lev1 6.607869 2000-01-01 Saturday, 2000-01-04 Tuesday, 2000-01-07 Friday, 2000-01-10 Monday etc. 2 2 lev1 6.598861 etc. 3 3 lev1 7.469262 4 1 lev2 27.488734 5 2 lev2 33.164037 6 3 lev2 34.466359 #How do I do this? #Cheers, #Lauri [[alternative HTML ver...
2007 Aug 16
1
Trim trailng space from data.frame factor variables
Hi folks, I would like to trim the trailing spaces in my factor variables using lapply (described in this post by Marc Schwartz: http://tolstoy.newcastle.edu.au/R/e2/help/07/08/22826.html) but the code is not functioning (in this example there is only one factor with trailing spaces): y1 <- rnorm(20) + 6.8 y2 <- rnorm(20) + (1:20*1.7 + 1) y3 <- rnorm(20) + (1:20*6.7 + 3.7) y <-
2007 Aug 07
2
Interaction factor and numeric variable versus separate regressions
...interaction summary(lm(y~x:f, data=d)) Call: lm(formula = y ~ x:f, data = d) Residuals: Min 1Q Median 3Q Max -2.8109 -0.8302 0.2542 0.6737 3.5383 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 3.68799 0.41045 8.985 1.91e-12 *** x:flev1 0.20885 0.04145 5.039 5.21e-06 *** x:flev2 1.49670 0.04145 36.109 < 2e-16 *** x:flev3 6.70815 0.04145 161.838 < 2e-16 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 1.53 on...
2007 Aug 08
1
tapply grand mean
Hi R-users, I have a data.frame like this (modificated from https://stat.ethz.ch/pipermail/r-help/2007-August/138124.html). y1 <- rnorm(20) + 6.8 y2 <- rnorm(20) + (1:20*1.7 + 1) y3 <- rnorm(20) + (1:20*6.7 + 3.7) y <- c(y1,y2,y3) x <- rep(1:5,12) f <- gl(3,20, labels=paste("lev", 1:3, sep="")) d <- data.frame(x=x,y=y, f=f) and this is how I can
2004 Jan 05
1
lda() called with data=subset() command
Hi I have a data.frame with a grouping variable having the levels C, mild AD, mod AD, O and S since I want to compute a lda only for the two groups 'C' and 'mod AD' I call lda with data=subset(mydata.pca,GROUP == 'mod AD' | GROUP == 'C') my.lda <- lda(GROUP ~ Comp.1 + Comp.2 + Comp.3 + Comp.4+ Comp.5 + Comp.6 + Comp.7 + Comp.8 ,
2007 Dec 01
2
How to cbind DF:s with differing number of rows?
#Hi R-users, #Suppose that I have a data.frame like this: y1 <- rnorm(10) + 6.8 y2 <- rnorm(10) + (1:10*1.7 + 1) y3 <- rnorm(10) + (1:10*6.7 + 3.7) y <- c(y1,y2,y3) x <- rep(1:3,10) f <- gl(2,15, labels=paste("lev", 1:2, sep="")) g <- seq(as.Date("2000/1/1"), by="day", length=30) DF <- data.frame(x=x,y=y, f=f, g=g) DF$g[DF$x == 1]
2011 Feb 11
6
linear models with factors
i am trying to fit a linear model with both continuous covariates and factors. When fitted with the intercept term the first level of the factor is treated by R as intercept and the estimate of the effects of remaining levels(say i th level) are given as true estimate of i th level - estimate of 1st level.can any please help me? thanks in advance..... -- View this message in context:
2013 Mar 11
2
how to convert a data.frame to tree structure object such as dendrogram
I have a data.frame object like: > data.frame(x=c('A','A','B','B'), y=c('Ab','Ac','Ba','Bd')) x y 1 A Ab 2 A Ac 3 B Ba 4 B Bd how could I create a tree structure object like this: |---Ab A---| _| |---Ac | | |---Ba B---| |---Bb Thanks, Zech [[alternative HTML version deleted]]
2005 Aug 04
1
[Bug 2947] stdout with [-v] -H --link-dest and slink/sock/fifo/regf
https://bugzilla.samba.org/show_bug.cgi?id=2947 wayned@samba.org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED ------- Additional Comments From wayned@samba.org 2005-08-03 16:45 ------- Keep in mind that --link-dest only hard-links regular