On 6/4/05, ronggui <[EMAIL PROTECTED]> wrote:
> i have data fame da:
> > da
>x y
> 1 1 a
> 2 2 a
> 3 3 a
> 4 4 a
> 5 5 a
> 6 6 b
> 7 7 b
> 8 8 b
> 9 9 b
> 10 10 b
> > str(da)
> `data.frame': 10 obs. of 2 variables:
> $ x: num 1 2 3 4 5 6 7 8 9 10
> $ y: Factor w/ 2 level
Try:
> da$z <- da$x - ave(da$x, da$y)
> da
x y z
1 1 a -2
2 2 a -1
3 3 a 0
4 4 a 1
5 5 a 2
6 6 b -2
7 7 b -1
8 8 b 0
9 9 b 1
10 10 b 2
Andy
> From: ronggui
>
> i have data fame da:
> > da
> x y
> 1 1 a
> 2 2 a
> 3 3 a
> 4 4 a
> 5 5 a
> 6 6 b
> 7 7
i have data fame da:
> da
x y
1 1 a
2 2 a
3 3 a
4 4 a
5 5 a
6 6 b
7 7 b
8 8 b
9 9 b
10 10 b
> str(da)
`data.frame': 10 obs. of 2 variables:
$ x: num 1 2 3 4 5 6 7 8 9 10
$ y: Factor w/ 2 levels "a","b": 1 1 1 1 1 2 2 2 2 2
and i want to generate new variable da$z,when y
Have you considered computing and plotting sample averages and
variances for different subgroups of the data then plotting variances
vs. averages? This was suggested by Fahrmeir and Tutz (2001)
Multivariate Statistical Modeling Based on Generalized Linear Models,
2nd ed. (Springer, Example
On 6/4/05, Rajarshi Guha <[EMAIL PROTECTED]> wrote:
> On Sat, 2005-06-04 at 13:18 -0700, Joe Conway wrote:
> > Gabor Grothendieck wrote:
> > > On 6/4/05, Adam Witney <[EMAIL PROTECTED]> wrote:
> > >>I am using PL/R in PostgreSQL amd have written some functions to
> > build my
> > >>data frame. Howe
On Sat, 2005-06-04 at 13:18 -0700, Joe Conway wrote:
> Gabor Grothendieck wrote:
> > On 6/4/05, Adam Witney <[EMAIL PROTECTED]> wrote:
> >>I am using PL/R in PostgreSQL amd have written some functions to
> build my
> >>data frame. However this can take some time with some large datasets
> and I
> >
Gabor Grothendieck wrote:
On 6/4/05, Adam Witney <[EMAIL PROTECTED]> wrote:
I am using PL/R in PostgreSQL amd have written some functions to build my
data frame. However this can take some time with some large datasets and I
would like to not have to repeat the process and so I would like to sav
Dear R users,
I am trying to fit a glm with a distribution free family, link = log and
variance = constant*mu. I guess I have to use the quasi family but the choices
of variance are restricted to constant or mu or mu^2..., I don't know the way
to choose the variance that I need, i.e. constant*
Andy Bunn whrc.org> writes:
:
: Adam:
: > Providing a reproducible example would be a first step...
:
: That's the problem, I can't. But I str has come to the rescue:
We can provide it in a reproducible way like this:
dput(rw)
dput(pg)
That will output both in a format that anyone else can p
On Sat, 2005-06-04 at 15:53 +0100, Dan Bolser wrote:
> On Sat, 4 Jun 2005, Marc Schwartz wrote:
>
> >On Sat, 2005-06-04 at 14:50 +0100, Dan Bolser wrote:
> >
> >
> >
> >> This must be because of the "log='y'" option that I am using here.
> >>
> >> y <- c(2,4,6,8,NA,NA,NA,NA,18)
> >>
> >> barplot
Adam:
> Providing a reproducible example would be a first step...
That's the problem, I can't. But I str has come to the rescue:
R > str(rw)
Time-Series [1:307] from 1690 to 1996: 0.986 1.347 1.502 1.594 1.475 ...
R > str(pg)
List of 264
$ : num 0.227
$ : num 0.189
$ : num 0.237
$ : num 0.23
On 6/4/05, Adam Witney <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> Is there anyway to store a data frame in a database, and by this I mean the
> binary itself, not the contents?
>
> I am using PL/R in PostgreSQL amd have written some functions to build my
> data frame. However this can take some time
> "Ross" == Ross Boylan <[EMAIL PROTECTED]>
> on Fri, 03 Jun 2005 17:04:08 -0700 writes:
Ross> I defined an S4 class with a slot i. Then I wrote a regular function
Ross> that attempted to increment i.
Ross> This didn't work, apparently because of the general rule that a
Hi,
Is there anyway to store a data frame in a database, and by this I mean the
binary itself, not the contents?
I am using PL/R in PostgreSQL amd have written some functions to build my
data frame. However this can take some time with some large datasets and I
would like to not have to repeat t
Dear ronggui,
You're fitted different variance models: in bptest(), you're modeling the
variance using any linear combination of the predictors, while in ncv.test()
you're modeling the variance as a function of the fitted values, which is
more restrictive. BTW, both bptest() and ncv.test() can do
On Sat, 4 Jun 2005, Uwe Ligges wrote:
>Dan Bolser wrote:
>
>[all previous stuff deleted]
>
>I see, what comes out of this longish thread is:
>
> - barplot() and barplot2() both have deficiencies for you particular
>examples, so it is time to provide patches for both barplot() and
>barplot2() (f
On Sat, 4 Jun 2005, Marc Schwartz wrote:
>On Sat, 2005-06-04 at 14:50 +0100, Dan Bolser wrote:
>
>
>
>> This must be because of the "log='y'" option that I am using here.
>>
>> y <- c(2,4,6,8,NA,NA,NA,NA,18)
>>
>> barplot2(y,log='y')
>>
>> Above fails.
>>
>>
>> I appreciate that what I am try
On 6/4/05, ronggui <[EMAIL PROTECTED]> wrote:
> i want to ask 2 questions.
>
> 1) can R do Random-effects GLS regression which i can get from Stata?
> the following result is frome Stata.can I get the alike result from R?
>
> xtreg lwage educ black hisp exper expersq married union, re
>
> Random
On Sat, 2005-06-04 at 14:50 +0100, Dan Bolser wrote:
> This must be because of the "log='y'" option that I am using here.
>
> y <- c(2,4,6,8,NA,NA,NA,NA,18)
>
> barplot2(y,log='y')
>
> Above fails.
>
>
> I appreciate that what I am trying to do is somewhat artificial (handle
> zero values o
Dan Bolser wrote:
[all previous stuff deleted]
I see, what comes out of this longish thread is:
- barplot() and barplot2() both have deficiencies for you particular
examples, so it is time to provide patches for both barplot() and
barplot2() (for the latter, you might want to contact the pac
On Sat, 4 Jun 2005, Uwe Ligges wrote:
>Dan Bolser wrote:
>
>> On Sat, 4 Jun 2005, Uwe Ligges wrote:
>>
>>
>>>Dan Bolser wrote:
>>>
I want to include missing values in my barplot to get the correct x-axis,
for example,
x <- c(1,2,3,4, 9)
y <- c(2,4,6,8,18)
barplot(y)
Dan Bolser wrote:
On Sat, 4 Jun 2005, Uwe Ligges wrote:
Dan Bolser wrote:
I want to include missing values in my barplot to get the correct x-axis,
for example,
x <- c(1,2,3,4, 9)
y <- c(2,4,6,8,18)
barplot(y)
The above looks wrong because the last height in y should be a long way
over.
On Sat, 4 Jun 2005, Uwe Ligges wrote:
>Dan Bolser wrote:
>> I want to include missing values in my barplot to get the correct x-axis,
>> for example,
>>
>> x <- c(1,2,3,4, 9)
>> y <- c(2,4,6,8,18)
>>
>> barplot(y)
>>
>> The above looks wrong because the last height in y should be a long way
>>
The misc3d package provides a small collection of mostly rgl-based
functions for 3D data:
contour3d Uses rgl to render isosurfaces, or three-dimensional
contours, computed by the marching cubes algorithm.
image3d Crude 3d analog of image() using rgl to plot points o
Dan Bolser wrote:
I want to include missing values in my barplot to get the correct x-axis,
for example,
x <- c(1,2,3,4, 9)
y <- c(2,4,6,8,18)
barplot(y)
The above looks wrong because the last height in y should be a long way
over.
So I want to do something like...
x <- c(1,2,3,4,5,6,7,8, 9)
I want to include missing values in my barplot to get the correct x-axis,
for example,
x <- c(1,2,3,4, 9)
y <- c(2,4,6,8,18)
barplot(y)
The above looks wrong because the last height in y should be a long way
over.
So I want to do something like...
x <- c(1,2,3,4,5,6,7,8, 9)
y <- c(2,4,6,8,0,0
i want to ask 2 questions.
1) can R do Random-effects GLS regression which i can get from Stata?
the following result is frome Stata.can I get the alike result from R?
xtreg lwage educ black hisp exper expersq married union, re
Random-effects GLS regression Number of obs =
Hi Thomas,
Your code works perfectly!
Thanks a lot,
Sander.
Thomas Lumley wrote:
On Fri, 3 Jun 2005, Sander Oom wrote:
Dear R users,
I have received a table in the following format:
id a b c1 c2 d1 d2
1 1 1 65 97 78 98
2 1 2 65 97 42 97
3 2 1 65 68 97 98
4
To illustrate (?) Professor Ripley comments, I send you an example (stolen in
various places...).
Note the tkwm.resizable(tt, 0, 0) directive that prevents the window rescaling
(if not,the coordinates will not be correct).
#
# Getting the mouse coords with TclTk
#
# Two possibilities: tkrplot pa
You have two asynchronous processes here: your R function will return,
leaving a Tk widget up. Duncan Murdoch's solution is to give you a
function that will retrieve at some future stage the result of the last
press (if any) of "Get coordinates" button. Is that what you want?
I think it is m
i am dealing with my panle data,and i have to decided if i should use
fixed-effect model or random effect model.i know the hausman test can help.
and anyone knows if any function can do these?
thank you.
__
R-help@stat.math.ethz.ch mailing list
https:/
31 matches
Mail list logo