Displaying 20 results from an estimated 11000 matches similar to: "Mixed models fixed effects"
2012 May 10
2
Outcome~predictor model evaluation, repeated measurements
Dear all,
I have simple question regarding how to fit a model (i.e. linear) to the
data.
Say I have 10 subjects with different phenotypes (dependent var Y,
identical for a particular subject) and one predictor variable measured 3
times for each subject (X). By other words:
Y Subj X
1 1 1.2
1 1 1.3
1 1 0.7
3 2 2.1
3 2 2.5
3 2 4
5 3 3
5 3 4
5 3 4
...
20 10 12
20 10 13
20 10 12.5
Subj is a
2013 Jan 28
1
incorrect import?
Dear all,
I'm not getting what I'm doing wrong. The line below from my read.fsa.bin function throws an error when just loading my AFLP package and disappears when I load the zoo package as well.
#the line that throws the error
Index <- which(Peak == rollmax(Peak, k = 1 + 2 * floor((min(diff(SizeStandard)) * Fs - 1) / 2), fill = -Inf))
#the error
Error in UseMethod("rollmax")
2009 Aug 13
4
un run run...
Hi All,
I am running an Rscript with a bunch of algorithms that are UNSTABLE
under some parameter settings.
At a certain point one of them sends error massage and my whole run STOPS!
What I would like is to save the error massage in some file or variable and
carry on to the next command line without stopping this run...
Any help or ideas would be welcome, please, with a concrete example
(not
2009 Sep 25
3
Problem on plotting TS using GGPLOT
Hi, I have following codes :
library(zoo); library(ggplot2); library(plyr)
dat <- rnorm(306); vv <- letters[1:6]; dat1 <- data.frame(dat, vv)
dat2 = zooreg(rnorm(51), as.yearmon(as.Date("2000-01-01")), frequency=12)
ggplot(dat1) +
geom_line(aes(y=dat, x=index(dat2), colour=vv), group=vv, size =
1.3)
However I got error while plotting them :
2012 Nov 05
2
averaging a list of matrices element wise
Dear all,
I have a list of n matrices which all have the same dimension (r x s). What would be a fast/elegant way to calculate the element wise average? So result[1, 1] <- mean(c(raw[[1]][1, 1] , raw[[2]][1, 1], raw[[...]][1, 1], raw[[n]][1, 1]))
Here is my attempt.
#create a dummy dataset
n <- 3
r <- 5
s <- 6
raw <- lapply(seq_len(n), function(i){
matrix(rnorm(r * s), ncol =
2009 Dec 22
2
Nested For loops
Dear R experts,
Might be very simple question to ask but would be insightful. As the same story of nested "for loops". following is the code that I am using to get the autocorrelation function of the sample data. I have tried to get rid of for loops but since I am touching R after such a long time that I need to practice more but I need help to revive my skills. I know that apply() or
2009 Jul 07
6
Uncorrelated random vectors
Hello,
is it possible to create two uncorrelated random vectors for a given distribution.
In fact, I would like to have something like the function "rnorm" or "rlogis" with the extra property that they are uncorrelated.
Thanks for your help,
Luba
[[alternative HTML version deleted]]
2010 Apr 19
2
ecdf
Hello,
I'd like to plot an empirical cumulative distribution function, except
instead of the fraction of values < x, I'd like the fraction of values > x.
I think this can be done using the ecdf function in {Hmisc}. I installed
the package and loaded it. However, when following the example given in the
documentation, I get an error:
x <- rnorm(100)
ecdf(x,what='1-F')
2009 Feb 11
2
Label bars in a faceted bar plot in ggplot2
Hi List,
I am running R 2.8.0 on a Windows XP machine, running ggplot2 version 0.8.1
I want to label the bars in a faceted grid barplot. Reproducible R
code is given below:
#### reproducible facet barplot #####
library(ggplot2)
# Dataset from which to create the barplot
ml <- rep(1:10,2)
vals <- rnorm(20,mean = 10, sd=1)
type <- c(rep("MAPE",10),rep("AIC",10))
2010 Apr 29
5
reduce size of pdf
is there a way to reduce the size of pdf files in R: ?
compression?
lower dpi ?
or some other option?
2009 Sep 08
4
barplot with lines instead of bars
Dear useRs,
I want to plot the following barplot with lines instead of bars. Is there a way?
data <- data.frame(cbind(k = 0:3, fk = c(11, 20,7,2), f0k = c(13.72, 17.64, 7.56, 1.08), fkest = c(11.85, 17.78, 8.89, 1.48)))
d <- t(data[,2:4])
barplot(d, beside=TRUE)
Regards,
Rafael.
____________________________________________________________________________________
[[elided Yahoo
2012 Nov 14
2
aggrete data from combination
Dear R users,
A have a dataframe (matrix) with two collumns (plot, and diameter (d)). I
want all diameters values for different combination of plots.
For example I want all d values for all posible combination, 100C2 (all d
values for plot 1 with all d values in the plot 2.......with all d values
from plot 1 with all d values from plot 100, ...... with all d values from
plot 99 with all d values
2009 Jul 29
3
predict
I have found a regression model, and i would like to predict value in
different points. I have tried to use predict function but it doesn't work.
I have used predict function like this:
newdata<-seq(from=0.1, to=0.32,by=0.02)
data<-predict(fm,newdata)
where fm is a regression model. The predict function return me that:
Error in eval(predvars, data, env) : numeric argument
2008 Aug 07
3
Bug in rnorm? (PR#12016)
Full_Name: Paul Eckermann
Version: 2.7.1
OS: Windows XP Service Pack 2
Submission from: (NULL) (129.127.183.12)
This is the first time I have submitted a bug report, so apologies if I have not
followed the correct protocol.
If I enter
length(rnorm(100*.29))
it returns 28 rather than 29.
y<-(1:100)/100
z<-sapply(y,function(x) length(rnorm(x*100)))
z!=100*y
indicates that it has
2012 Oct 30
2
help with lme
Dear Madam or Sir
I am writing you hoping, that you can help me with a problem concerning the output of regressions done with the function lme in R.
I would need the standard deviations for intercepts and predictors, but in the output I can only find those for the intercepts. Could it be, that this is my fault? (I am just a beginner with R and multilevel modeling).
I am sorry to annoy you with
2009 Jul 22
1
Link to documentation in another package
Dear all,
One of the functions that I wrote (ggsave.latex) extents the
functionality of a function (ggsave) in another package (ggplot2).
Instead of copying all the information I would like to create a link in
the helpfile of ggsave.latex to the helpfile of ggsave. I tried
\code{\link{ggsave}} and \code{\link{ggplot2::ggsave}}, but neither
worked. Both cases gave a 'missing link' warning.
2009 Apr 17
2
Generate bivariate binomial data
Dear all,
Could someone point me to a function or algorithm to generate random
bivariate binomial data?
Some details about what I'm trying to do. I have a dataset of trees who
were categorised as not damaged or damaged. Each tree is measured twice
(once in two consecutive years). The trees can recover from the damage
but the data is clearly correlated. As a (un)damaged tree is more likely
2013 Jul 25
1
GGplot 2 – cannot get histogram and box plot axis to match.
Problem:
I am trying to get the histogram and box plot x axis to match. I?ve tried using the expand_limits function to make the axis match but that didn?t make the axis match. The histogram?s axis are still consistently larger than the ones for the box plot (though the function did help). Does anyone have a suggestion as to what I should do instead?
Background:
I am building a Shiny app that
2009 May 19
2
Coord_equal in ggplot2
Dear all,
I'm plotting some points on a graph where both axes need to have the
same scale. See the example below. Coord_equal does that trick but in
this case it wastes a lot of space on the y-axis. Setting the limits of
the y-axis myself was no avail.
Any suggestions to solve this problem?
library(ggplot2)
ds <- data.frame(x = runif(1000, min = 0, max = 300000), y = runif(1000,
min =
2009 Jan 13
5
indexing question
Hi all,
i have a pretty easy indexing question, at least i believe so. The
main reason i post it here, is that brackets and $ are hard to google.
How do I index correctly, if i just want to display the whole dataset
conditioned on the fact that some particular column equals one.
I know i can do something like: data$somecolumn[data$particularcol
==1] . That will show all "some