Displaying 20 results from an estimated 10000 matches similar to: "fixed effects anova in lme lmer"
2009 Feb 08
1
sub() with "+" - invalid regular expression
Hi,
can someone help me;
I don't understand why this code doesn't do what it's supposed to do;
x <- c("F+", "F+")
x <- sub("F+", "F", x)
x
[1] "F+" "F+"
(I want "F" "F")
when I try this;
x <- c("F+", "F+")
x <- sub("+", "", x)
x
I get an error
2016 Apr 29
2
selecting columns from a data frame or data table by type, ie, numeric, integer
Good morning RGuru's
I have a data frame of 575 columns.? I want to extract only those columns that are numeric(double) or integer to do some machine learning with.? I have searched the web for a couple of days (off and on) and have not found anything that shows how to do this.?? Lots of ways to extract rows, but not columns.? I have attempted to use "(x == y)" indices extraction
2016 Apr 29
0
selecting columns from a data frame or data table by type, ie, numeric, integer
> dt1[ vapply(dt1, FUN=is.numeric, FUN.VALUE=NA) ]
a c
1 1 1.1
2 2 1.0
...
10 10 0.2
Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Fri, Apr 29, 2016 at 9:19 AM, Carl Sutton via R-help <
r-help at r-project.org> wrote:
> Good morning RGuru's
> I have a data frame of 575 columns. I want to extract only those columns
> that are numeric(double) or integer to do
2023 Nov 03
2
Sum data according to date in sequence
Hi,
I tried this:
# extract date from the time stamp
dt1 <- cbind(as.Date(dt$EndDate, format="%m/%d/%Y"), dt$EnergykWh)
head(dt1)
colnames(dt1) <- c("date", "EnergykWh")
and
my dt1 becomes these, the dates are replace by numbers.
dt1 <- cbind(as.Date(dt$EndDate, format="%m/%d/%Y"), dt$EnergykWh)
dput(head(dt1))
colnames(dt1) <-
2023 Nov 03
1
Sum data according to date in sequence
Is this what you are after?
library(tidyverse)
library(lubridate)
input <- structure(list(StationName = c("PALO ALTO CA / CAMBRIDGE #1",
"PALO ALTO CA / CAMBRIDGE #1", "PALO ALTO CA / CAMBRIDGE #1",
"PALO ALTO CA / CAMBRIDGE #1", "PALO ALTO CA / CAMBRIDGE #1",
"PALO ALTO CA / CAMBRIDGE #1", "PALO ALTO CA / CAMBRIDGE
2006 Sep 20
1
seq.Date not accepting NULL length.out (PR#9239)
There seems to be a bug in seq.Date such that it will not allow the user
to pass in length.out =3D NULL, despite the fact that this is the =
default
argument.
For example:
> dt1 <- as.Date("2004-12-31")
> dt2 <- as.Date("2005-12-31")
> seq.Date(dt1, dt2, length.out =3D NULL, by =3D "month")
Error in seq.Date(dt1, dt2, length.out =3D NULL, by =3D
2011 May 10
1
Saving multiple 3x3 TIFF graphics inside a loop
Dear Friends,
I have been trying to save multiple 3x3 (mfrow=c(3,3) graphics inside a loop
using tiff figure format (not using PDF or savePlot functions) with no
success. Could you please help?
Here is a simplified example code:
dat=data.frame (ID=rep(1:10,each=10),IDV=rep(seq(1:10),times=10))
dat$DV <- with(dat, 50+15*IDV)
dat=dat[order(dat$ID,dat$IDV),]
for(i in 1:10){
dt1 =
2000 Dec 25
2
Modification requests / question
Hello!
1.
You should modify the 'vorbis_ftoi(f)' for the undefinied OS/compiler
in the 'os.h' on this way:
old:
static int vorbis_ftoi(double f){
return (int)(f+.5);
}
new:
#define vorbis_ftoi(f) ((int)(f+.5f))
Because in some cases we don't use this function, and the compiler writes
many error messages.
2. Could you write a frequency and bitrate independent
2013 Aug 16
1
as.Date.character speed improvement suggestion
R-Devel,
I store and retrieve a large amount of financial data (millions of rows) in a PostgreSQL database keyed by date (and represented in R by class Date). Unfortunately, I frequently find that a great deal of processing time is spent converting dates from character representations to Date class representations in R, presumably because strptime is not fast for large vectors (>10,000
2008 May 08
2
Microseconds for a zoo object?
Hello
I have a string which contains microseconds, can anyone help on
constructing this in to a time object, with the microseconds, that I can
take to a ZOO file?
Thanks
Sean
> UK[1,3]
[1] "17:09:53.824"
> UK[1,1]
[1] "2007-12-11 00:00:00"
> mydates <- paste( substr(UK[,1], 1, 10), UK[,3])
> mydates[1]
[1] "2007-12-11 17:09:53.824"
>
2007 Jun 01
2
how to specify starting values in varIdent() of lme()
I was reading the help but just did not get how to specify starting values for
varIdent() of the lme() function, although I managed to do it for corSymm().
Do I specify the values just as they are printed out in an output, like c(1,
1.3473, 1.0195). Or do I need to take the residual and multiply it with these
like c(0.2235, 0.2235*1.3473, 0.2235*1.0195)
or any other form that I dont know of?
2012 Jun 13
1
histogram fill lattice
Dear all,
I would like to change the "fill" pattern of a histogram using histogram() in the lattice package. I know how to do so using hist(), but would prefer to stay within lattice.
dt1 <- rnorm(100,0,1)
hist(dt1, density=3, angle=45)
library(lattice)
histogram(dt1,
xlab = "Histogram of rnorm(0,1)",
type = "count",
2003 Sep 29
1
CP for rpart
Hi All,
I have some questions on using library rpart. Given my data below, the
plotcp gives me increasing 'xerrors' across different cp's with huge xstd
(plot attached). What causes the problem or it's not a problem at all? I am
thinking 'xerror's should be decreasing when 'cp' gets smaller. Also what
the 'xstd' really tells us? If the error bars for
2012 Mar 05
1
index instead of loop?
Hello,
Does anyone know of a way I can speed this up? Basically I'm attempting to
get the data item on the same row as the report date for each report date
available. In reality, I have over 11k of columns, not just A, B, C, D and
I have to do that over 100 times. My solution is slow, but it works. The
loop is slow because of merge.
# create sample data
z.dates =
2003 Jan 18
1
SAS transport files and the foreign package
Even though the FDA has no policies at all that limit our choices of statistical software, there is one defacto standard in place: reliance of the SAS transport file format for data submission (even though this format is deficient for this purpose, e.g., it does not even document value labels or units of measurement in a self-contained way). Because of the widespread use of SAS transport files in
2017 Nov 27
0
How to extract coefficients from sequential (type 1) ANOVAs using lmer and lme
I wantto run sequential ANOVAs (i.e. type I sums of squares), and trying to getresults including ANOVA tables and associated coefficients for predictive variables(I am using the R 3.4.2 version). I think ANOVA tables look right, but believecoefficients are wrong. Specifically, it looks like that the coefficients arefrom ANOVA with ?marginal? (type III sums of squares). I have tried both lme
2007 May 21
1
can I get same results using lme and gls?
Hi All
I was wondering how to get the same results with gls and lme. In my lme, the
design matrix for the random effects is (should be) a identity matrix and
therefore G should add up with R to produce the R matrix that gls would report
(V=ZGZ'+R). Added complexity is that I have 3 levels, so I have R, G and say H
(V=WHW'+ZGZ'+R). The lme is giving me the correct results, I am
2017 Nov 29
0
How to extract coefficients from sequential (type 1), ANOVAs using lmer and lme
(This time with the r-help in the recipients...)
Be careful when mixing lme4 and lmerTest together -- lmerTest extends
and changes the behavior of various lme4 functions.
>From the help page for lme4-anova (?lme4::anova.merMod)
> ?anova?: returns the sequential decomposition of the contributions
> of fixed-effects terms or, for multiple arguments, model
>
2008 Aug 07
1
incorrect usage of glmer crashes R (PR#12375)
Full_Name: susscorfa
Version: 2.7.1
OS: ubuntu
Submission from: (NULL) (129.125.177.31)
Incorrect implementation of the grouping variable in the function glmer crashes
R
a small example:
require(lme4);
a<-data.frame(b=rpois(1000,10), c=gl(20,50), d=rnorm(1000,3), e=rnorm(1000,5),
f=rnorm(1000,2)+5);
glmer(b~d+f|c+(e), family=poisson, data=a)
It crashes R on debian linux (2 independant
2008 Aug 11
1
Simple lme/lmer random effects questions
Hello,
I have two very rudimentary questions regarding the random effects terms
in the lme and lmer functions. I apologize if this also partly strays
into a general statistics question, but I'm a bit new to this all. So
hopefully it'll be a quick problem to sort out...
Here is my experimental setup: I raised butterflies in 5 different
testing chambers all set to different