Displaying 20 results from an estimated 1000 matches similar to: "lme nesting/interaction advice"
2003 Oct 22
1
passing a variable (containing the value of the argument) to a function
My previous question put in a simpler way:
How would I pass a value of a variable to a function such as
lm(Effect1~Trt*Dose, data = x, contrasts = list(Trt = contr.sum, Dose =
contr.sum))?
Here, 'Effect' is a column name in my data matrix, and I want "Effect1" to
be replaced by "Effect2" and so on (my other column names in the data
frame) for successive anova
2003 Jul 14
1
methods help and glmmPQL
Dear All,
I would like to ask you to help me with my memeory. I remember using some
function that would list all the possible methods I could apply to an
object. Say, if I had an object of
class=lme,
it would tell me that that I could do stuff like
qqnorm(myobjct), or VarCorr(myobject). In general, a very complete list.
I though this list of all possible methods would pop out by typing
2005 Jun 27
1
stage left and right effects
Here are two effects (with a common base) that perform a stage
left/right effect. The effect is named after the Hanna Barbara
character Snagglepuss. :) It shakes the contents briefly and then
jets off (stage) to the left or right.
I used the Shake effect as a guide to this one. The StageBase accepts
the element and an "amount" to initially shake the element by. So in
2006 Feb 28
4
subsetting a list of matrices
Hi All,
I have a list of matrices:
> x
[,1] [,2]
[1,] 1 4
[2,] 2 5
[3,] 3 6
> y
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] 18 21 24 27 30 33
[2,] 19 22 25 28 31 34
[3,] 20 23 26 29 32 35
> z =list(x,y)
I want to create a second list that is has a subset each matrix in the
list subsetting so I get the 2nd and 3rd row of each (and
2005 Mar 08
5
removing message: [Previously saved workspace restored]
Dear All,
I saved by mistake the environment I was working in after typing q(),
and now I get the annoying message:
[Previously saved workspace restored]
I have already deleted all the objects in the environment, saving it as
an empty environment, so it's just a matter of nitpicking I suppose. The
message does not appear if I start R from any other place in the
directory tree.
I am
2005 Jun 24
1
Blind Toggle "effect"
I wrote a simple toggle function similar to Element.toggle that will
toggle a section between being up and down using the Blind effect.
I''m relatively new to the code, so I''m not sure if it''s implemented
100% correctly or if it can be done better. I am using it though and
it seems to be working fine.
Anyway, here''s the code and if you think it''s
2006 Sep 26
5
putting stuff into bins...
Hi All,
I have a vector of data, a vector of bin breakpoints and I want to put my data
in the bins and then extract fanciful informations like the mean value of each bin.
I know I can write my own function, but I would have thought that R should have
somewhere a function that took as arguments something like (data, breaks, what
to do with the data in the bins). I surey could not find it
2007 Jun 26
2
fisher information matrix
Hi All,
a colleague wants to calculate the Fisher information matrix for a model he
wrote (not in R). He can easily get the neg-log-likelihood and the best fit
parameters at the minimum. He can also get negLLs for other parameter values too.
Given these data, is there a way in R to calculate the Fisher information matrix?
Best,
Federico
--
Federico C. F. Calboli
Department of Epidemiology
2006 Mar 28
2
as.matrix and one row
Hi All,
I have the following problem:
x = c(1,2)
x
[1] 1 2
as.matrix(x)
[,1]
[1,] 1
[2,] 2
BUT, if I add:
y = c(3,4)
as.matrix(rbind(x,y))
[,1] [,2]
x 1 2
y 3 4
It does not transpose. Since I will need as.matrix() for a list of data
that is in one or more lines, I need as.matrix to behave in a consisten
fashions, so I get
as.matrix(x, whatever)
[,1] [,2]
x 1
2006 Mar 08
3
'less' for R?
Hi All,
is there an equivalent of the Unix command 'less' (or 'more'), so I can
look at what's inside a data.frame or a matrix without having it printed
out on console?
I am using R on Debian Linux and Mac OS 10.4.5
Cheers,
F
--
Federico C. F. Calboli
Department of Epidemiology and Public Health
Imperial College, St Mary's Campus
Norfolk Place, London W2 1PG
Tel +44
2006 Feb 08
2
logical condition in vector operation
HI All,
I have a data frame such as:
> test
x y p d
[1,] 1 0 10 21 0
[2,] 2 3 11 12 0
[3,] 3 4 12 23 0
[4,] 3 5 13 24 0
and I want to perfor some operations on the first two coulums,
conditional on the uneqaulity values on the 3rd and 4th columns.
For instance:
j = 3
test[test[,1] == j, 5] = test[test[,1] == j,2] + test[test[,2] == j,1]
gives me the result:
test:
x y p d
2006 Jun 07
3
smoothing plot(x, type ='l')
Hi All,
I am using plot(x, type = 'l') for some plotting, but I would like rounded edges
rather than jagged edges in the plot (purely for aestetic reasons).
How could I achieve that?
Cheers,
Federico
--
Federico C. F. Calboli
Department of Epidemiology and Public Health
Imperial College, St Mary's Campus
Norfolk Place, London W2 1PG
Tel +44 (0)20 7594 1602 Fax (+44) 020
2006 Oct 26
2
pairs matchning
Hi
You could try to find an equivalent representation as a string and try to
match those.
> (A <- cbind(sample(1:2, 10, rep=TRUE), sample(1:2, 10, rep=TRUE)))
[,1] [,2]
[1,] 1 2
[2,] 1 2
[3,] 1 2
[4,] 2 2
[5,] 1 1
[6,] 1 2
[7,] 1 2
[8,] 1 1
[9,] 1 2
[10,] 1 1
> (B <- unique(A))
[,1] [,2]
[1,] 1 2
2005 Apr 12
2
R as programming language: references?
Hi All,
I am looking for references on R as a programming language (apart form
the standard R-lang.pdf and the other manuals), reference that would
cover _in_depth_ things like loops, code optimisation, debugging tools
etc... and is as up-to-date as possible.
Can anyone suggest any book or other reference apart from the "green
book" and the V&R "S-programming"?
Cheers,
2006 Apr 21
2
forcing apply() to return data frame
Hi All,
I am (almost) successfully using apply() to apply a function recursively
on a data matrix. The function is question is as.genotype() from the
library 'genetics'
apply(subset(chr1, names$breed == 'lab'),2,as.genotype,sep ="")
Unfortuantely apply puts it's results into a matrix object rather than a
data frame, tranforming my factors into numerics and
2005 Jun 24
1
Executing custom effect for n seconds
Glad to see this list get going!
I have a custom effect ''Pulse'' that basically does an opacity fade in/
out.
I want to execute this effect with a custom duration.
I''m looking for a consistent approach that is inline with
script.alicio.us and Prototype.
Is there a way to do something like this (pseudo code):
Effect2.Pulse = function(element) {
new
2005 Apr 05
5
Help with three-way anova
Hi
I have data from 12 subjects. The measurement is log(expression) of a
particular gene and can be assumed to be normally distributed. The 12
subjects are divided into the following groups:
Infected, Vaccinated, Lesions - 3 measurements
Infected, Vaccintaed, No Lesions - 2 measurements
Infected, Not Vaccinated, Lesions - 4 measurements
Uninfected, Not Vaccinated, No Lesions - 3 measurements
2005 Apr 05
2
cat bailing out in a for loop
Dear All,
I am trying to calculate the Hardy-Weinberg Equilibrium p-value for 42
SNPs. I am using the function HWE.exact from the package "genetics".
In order not to do a lot of coding "by hand", I have a for loop that
goes through each column (each column is one SNP) and gives me the
p.value for HWE.exact. Unfortunately some SNP have reached fixation and
HWE.exact requires a
2005 Jul 21
3
vectorising ifelse()
Hi All,
is there any chance of vectorising the two ifelse() statements in the
following code:
for(i in gp){
new[i,1] = ifelse(srow[i]>0, new[srow[i],zippo[i]], sample(1:100, 1,
prob =Y1, rep = T))
new[i,2] = ifelse(drow[i]>0, new[drow[i]>0,zappo[i]], sample(1:100,
1, prob =Y1, rep = T))
}
Where I am forced to check if the value of drow and srow are >0 for each
line... in
2011 Jan 14
2
read in data, maintain decimal places
Good day, All,
Is there any way to maintain the number of decimal places in the type of situation below?
I would like to maintain the number of decimal places in 0.667, despite the fact that its column-mates have a fourth decimal place.
Thank you for your time.
Jim
dat.txt contents:
MARKER ALLELES FREQ1 RSQR EFFECT2 STDERR CHISQ PVALUE
rs6599753 C,T