On Thu, 2006-01-19 at 16:21 -0600, Deepayan Sarkar wrote:
On 1/19/06, Deepayan Sarkar [EMAIL PROTECTED] wrote:
On 1/19/06, Bill Simpson [EMAIL PROTECTED] wrote:
If I used a groupedData object, if I do
fit-lme(blah)
then
plot(augPred(fit))
produces a nice trellis plot of the data
If I used a groupedData object, if I do
fit-lme(blah)
then
plot(augPred(fit))
produces a nice trellis plot of the data along with the fitted lines
However I find that the lines and the data points are in the same colour
(light blue against a medium grey background). Is there a way to make
the
=???|subject???, data=df1)
I am familiar with the steps of model building using lm(), exploring
different models etc, so I think I will be OK once I get the idea of
specifying the basic lme model.
I have Pinheiro and Bates (2000) here.
Thanks very much for any help
Bill Simpson
The following code is slow and ugly:
count-0
for(i in 1:nrow(ver))
for(j in 1:ncol(ver))
{
count-count+1
x[count]-pt$x[ver[i,j]]
y[count]-pt$y[ver[i,j]]
z[count]-pt$z[ver[i,j]]
}
Please help me make it better.
Thanks!
Bill
To clarify: I want to get rid of the loop over i,j
Here is a simpler example. ver is a 2D matrix
count-0
for(i in 1:nrow(ver))
for(j in 1:ncol(ver))
{
count-count+1
x[count]-ver[i,j]
}
Bill
__
R-help@stat.math.ethz.ch mailing list
Thanks Marc for your help.
The following code is slow and ugly:
count-0
for(i in 1:nrow(ver))
for(j in 1:ncol(ver))
{
count-count+1
x[count]-pt$x[ver[i,j]]
y[count]-pt$y[ver[i,j]]
z[count]-pt$z[ver[i,j]]
}
Please help me make it better.
On Fri, 22 Apr 2005, Marc Schwartz wrote:
Thus, I just need to use t(ver) instead of ver:
x - pt$x[t(ver)]
y - pt$y[t(ver)]
z - pt$z[t(ver)]
That should do it?
Yep!!
Thanks very much Marc and others who suggested this.
Cheers
Bill
__
Sorry -- I meant to say dataframe instead of matrix.
Anyway I see that my troubles are gone when I scan the data in as a vector
then convert to matrix. (I had troubles doing such manipulations when I
read in the data using read.table)
x-scan(/home/wsimpson/papers/face/max.dat)
xx-matrix(x,
I want to flatten a matrix and unflatten it again. Please tell me how to
do it.
1. given a matrix:
x1 y1 z1
x2 y2 z2
...
xk yk zk
convert it to a vector:
x1, y1, z1, x2, y2, z2, ..., xk, yk, zk
2. given a vector:
x1, y1, z1, x2, y2, z2, ..., xk, yk, zk
convert it to a matrix
x1 y1 z1
x2 y2 z2
In case others are looking for a simple way to read in .jpeg files as
ordinary matrices, here is my solution. I am only interested in greyscale
images, so you will have to alter the following if you want colour.
Most .jpegs are colour, so first step is to open the file with ImageMagick
display
for(i in 1:dims[1]) x[i,]-rev(x[i,]) #flip the image vertically
Courtesy of Rolf Turner, here is a much better way to flip vertically:
x - x[,ncol(x):1]
Bill
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
appropriate for
what I am doing. Any pointers on how to do that in R or to any info are
appreciated.
Bill Simpson
__
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting
help
Bill Simpson
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
I am drawing several contour plots in one page. I use image, and get
several contours. But I don't know how to control the color in more than one
plots. For example, same color corresponds to different dependent values
in different plots. For example, yellow means z=100(the highest value)
in
appears to be: if z==1, y~x+z; else y~z
(y~z + z:x isn't it)
How can I express this model in lm()? If I can't express it properly in
lm(), what is the best way to fit the model?
Thanks for any help.
Bill Simpson
__
[EMAIL PROTECTED] mailing list
https
Thanks very much John Peter for your help.
Bill
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
I would like to compute p = count1/(count0 +count1). For example, for
x=0.012289, p= 12/(1+12)= 0.923077. Please tell me how to do it. Maybe
there is a better way to do this without going through table().
Thanks very much for any help.
Bill Simpson
one way that works is:
sapply(split(y,x), mean)
Bill
__
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
18 matches
Mail list logo