Displaying 6 results from an estimated 6 matches for "trait1".
Did you mean:
traits
2012 May 12
1
problem with get() inside of lme()
Hi,
In the following lines of code are inside of a function, where "TRAIT1" is
a function variable calling a column-name inside of the data.frame "new3".
This works just fine:
m2 <- lmer(get(TRAIT1) ~ perm.score + (1|site), data=new3)
but this will not work,
m3 <- lme(get(TRAIT1) ~ perm.score , random= ~1|site, data=new3)
I get the following er...
2010 Jan 13
4
merging issue.........
hi, I have a question about merging two files.
For example, I have two files, the first file is like the following:
id trait1
1 10.2
2 11.1
3 9.7
6 10.2
7 8.9
10 9.7
11 10.2
The second file is like the following:
id trait2
1 9.8
2 10.8
4 7.8
5 9.8
6 10.1
12 10.2
13 10.1
now I want to merge the two files by the variable "id", I only want to keep
the "id"s...
2009 Jul 27
1
Cross-validating two matrices
...one matrix so that the species list
matches those in a second matrix? Ideally, I need to prune both
matrices so that they include only the species found in both. In this
case, the two matrices would therefore include only sp1,sp4,sp5.
Thank you so much for any suggestions!
E.g.:
Matrix 1:
Trait1
sp1 1.0
sp2 1.2
sp4 3.1
sp5 4.0
sp7 4.5
Matrix 2
sp1 sp3 sp4 sp5 sp6
plot1 1 2 5 1 0
plot2 3 0 1 2 5
plot3 1 1 2 3 1
plot4 0 1 2 1 0
Brian C. McCarthy, Ph.D.
Professor of Forest Ecology
Dept. of Environmental & Plant Biology
317 Porter Hall
Ohio University
Athens, OH 45701-2979 USA
T:...
2011 Apr 14
0
extract p-value from mixed model in kinship package
...m, ped$id, ped$momid, ped$dadid)
set.seed(3456)
SNPdata <- c(1:1000)
dat <- sample(c(-1,0,1), 10000, replace = TRUE)
snpmat<- data.frame(matrix(dat, ncol = 100))
names(snpmat) <- c(paste ("VR",1:100, sep='' ))
yvar <- rnorm(100, 30, 5)
mydata <- data.frame(trait1, covtrait, snpmat)
fmod <- lmekin(y~ mydata[,i] , data= snpdata, random = ~1|id,
varlist=list(kmat)) $coefficients[2,4] # does not work
Ultimately I want to put into the loop:
for(i in 3:length(snpdata)) {
P <- vector (mode="numeric", length = 1000)
P[i] <- lmekin(trait1~ sn...
2011 Nov 24
4
I cannot get species scores to plot with site scores in MDS when I use a distance matrix as input. Problems with NA's?
...dination using the function ?metaMDS? of the ?vegan? package. I want to ordinate species according to a set of functional traits. ?Species? here refers to ?sites? in traditional vegetation analyses while ?traits? here correspond to ?species? in such analyses.
My data looks like this:
Trait1 Trait2 Trait3 Trait4 Trait5 Trait?
Species1 228.44 16.56 1.66 13.22 1 short
Species2 150.55 28.07 0.41 0.60 1 mid
Species3 NA 25.89 NA 0.55 0 large
Species4 147.70 17.65 0.42 1.12 NA large
Species? 132.68 NA 1.28 2.75...
2010 Mar 17
2
How to use "ifelse" to generate random value from a distribution
I need use different parameters of distribution for different case to
generate random value, but I use ifelse, the generated value is fixed
without change.
Here is example
data1
y x
1 1 2
2 2 1
3 3 2
4 4 3
5 5 3
6 6 1
7 7 2
8 8 1
9 9 1
10 10 3
11 11 3
12 12 2
ifelse(data1$x==1,rnorm(1,2,1),ifelse(data1$x==2,rnorm(1,-2,1),rnorm(1,110,1)))
[1] -1.8042172 0.8478681