Ann Hess hess at stat.colostate.edu writes:
Here is my model statement:
Model-lm(log2PM~P+T+P*T)
where P has 16 levels, T(treatment) has 12 levels and I am interested in
looking at different treatment comparisons.
With so many levels, you should do something against fishing for error
Dear R listers,
I'm trying use Huber's m-estimator on a dataset, which works fine so
far.
In the next step I would like to assign a (frequency) weight to the
observations.
It seemed straight forward to me to replicate the rows according to
their count variable.
Unfortunately, a solution
Dear all,
given I have data in a data.frame which indicate the number of people in
a
specific year at a specific age:
n - 10
mydf - data.frame(yr=sample(1:10, size=n, replace=FALSE),
age=sample(1:12, size=n, replace=FALSE),
no=sample(1:10, size=n,
just try
mymatrix - matrix(0, 12, 10)
mymatrix[cbind(mydf$age, mydf$yr)] - mydf$no
mymatrix
I hope it helps.
Best,
Dimitris
Dimitris Rizopoulos
Ph.D. Student
Biostatistical Centre
School of Public Health
Catholic University of Leuven
Address: Kapucijnenvoer 35, Leuven, Belgium
Tel:
On Thu, 8 Dec 2005, Daniel Metzler wrote:
Dear R listers,
I'm trying use Huber's m-estimator on a dataset, which works fine so
far.
Huber's M-estimator of what? Location, scale, regression, AR coefficients
What software are you using to do so?
In the next step I would like to
hi netters,
i have a dataframe TEST like this:
Y1 Y2 Y3
X1 4 7 8
X2 6 2 Z
X3 8 0 1
i would like to change it to a numeric matrix, replacing Z with NA
Y1 Y2 Y3
X1 4 7 8
X2 6 2 NA
X3 8 0 1
i've tried the function data.matrix but it didn't work. is there any easy
way to
Hi,
thank you very much for your fast reply. It worked fine.
In the meantime, I also had now an idea using a function from the
apply-family (see below for the code).
The more I use R, the more I get the impression that either the
apply-family or outer() can solve most of my data-transformation
Rau, Roland [EMAIL PROTECTED] writes:
Dear all,
given I have data in a data.frame which indicate the number of people in
a
specific year at a specific age:
n - 10
mydf - data.frame(yr=sample(1:10, size=n, replace=FALSE),
age=sample(1:12, size=n, replace=FALSE),
hi all,
I've got a data frame, this data frame have 76 columns and 22600 rows.
The data inside can be redundant because the data can be captured
simultaneously and overlap each other.
My aim is to supress these overlaps
I've test some solutions to do that but they all give a big cpu load and
Using Hmisc, I get the following output from format.df (which will feed to
latex)
Min Q1 Med Mean Q3 Max
Age 30 32.5 36 37.50 41.00 49
Height 174 175.0 178 179.00 181.00 188
Weight 68 74.0 78 76.67 79.75 83
Automatic decimal points adjustments does not
A way to do it :
TEST$Y3[TEST$Y3==Z] - NA
TEST$Y3 - as.numeric(TEST$Y3)
2005/12/8, zhihua li [EMAIL PROTECTED]:
hi netters,
i have a dataframe TEST like this:
Y1 Y2 Y3
X1 4 7 8
X2 6 2 Z
X3 8 0 1
i would like to change it to a numeric matrix, replacing Z with NA
Y1 Y2
and then, if you want a matrix and not a data.frame :
TEST - as.matrix(TEST)
2005/12/8, David Hajage [EMAIL PROTECTED]:
A way to do it :
TEST$Y3[TEST$Y3==Z] - NA
TEST$Y3 - as.numeric(TEST$Y3)
2005/12/8, zhihua li [EMAIL PROTECTED]:
hi netters,
i have a dataframe TEST like this:
Dear R users:
I want to plot all the Y1 vs. X1 which in list coffee together,
in the same plot.
coffee
[[1]]
Y1X1
1 0.0 10.006306
2 0.5 9.433443
3 1.0 8.893405
4 2.0 7.904274
[[2]]
Y1X1
1 0.0 10.015972
2 0.5 9.460064
3 1.0 8.935039
4 2.0 7.970755
[[3]]
Y1
Dieter Menne dieter.menne at menne-biomed.de writes:
Using Hmisc, I get the following output from format.df (which will feed to
latex)
Min Q1 Med Mean Q3 Max
Age 30 32.5 36 37.50 41.00 49
Height 174 175.0 178 179.00 181.00 188
Weight 68 74.0 78
you probably have a dataframe like this :
z - data.frame(y1=c(1,2,3),y2=c(4,5,6),y3=c(4,z,5))
you can do :
z - as.matrix(z)
mode(z) - numeric
zhihua li a écrit :
hi netters,
i have a dataframe TEST like this:
Y1 Y2 Y3
X1 4 7 8
X2 6 2 Z
X3 8 0 1
i would like to change it to a
Hello!
I interest of using Perl for application of biostatistcs with R. I find your
module on the cpan's site. But, I've a question:
Could I use it with Mac OS X? Because I have this error:
Error: no suitable installation target found for package Statistics-R.
If it's not possible with this
Dear R Users,
Before running ksmooth( ), a suitable bandwidth selection is needed. I use
some functions for this task and receive these results for my data:
width.SJ(y,nb=100,method=ste) : 40.25
bcv(y,nb=100) : 40.53
ucv(y): 41.26
bandwidth.nrd(y) : 45.43
Hi
I'm using kronecker() with a matrix and a vector. I'm interested in
the column names that kronecker() returns:
a - matrix(1:9,3,3)
rownames(a) - letters[1:3]
colnames(a) - LETTERS[1:3]
b - c(x=1,y=2)
kronecker(a,b,make.dimnames=TRUE)
A: B: C:
a:x 1 4 7
a:y 2 8 14
b:x
Hy!
Now im doing a statistical matching (datafusion) microsimulation
project, and i try to programme it in R.
Has everybody any experience (R codes, which package to use...) in this
theme?
Zoltan Kmetty
Hungarian Central Statistical Office
[[alternative
Dear list,
I am using R 2.1.1 on a Fedora 3 Linux, 32 bit PC.
If I compute the aggregated mean and the standard deviation I get
standard deviation values for factors where the mean was not computed.
It seems to me that this is somehow related to the NA values. But I
don't quite understand what
Guillaume,
Will functions unique() or duplicated() help you?
(Comment on trailing ; withheld so as not to revive recent thread.)
Peter Ehlers
[EMAIL PROTECTED] wrote:
hi all,
I've got a data frame, this data frame have 76 columns and 22600 rows.
The data inside can be redundant because
On 12/8/05 5:20 AM, béline jesson [EMAIL PROTECTED] wrote:
Hello!
I interest of using Perl for application of biostatistcs with R. I find your
module on the cpan's site. But, I've a question:
Could I use it with Mac OS X? Because I have this error:
Error: no suitable installation
On 12/8/05 6:29 AM, béline jesson [EMAIL PROTECTED] wrote:
Le 8/12/05 12:12, « Sean Davis » [EMAIL PROTECTED] a écrit :
On 12/8/05 5:20 AM, béline jesson [EMAIL PROTECTED] wrote:
Hello!
I interest of using Perl for application of biostatistcs with R. I find your
module on
Hi
yesterday was answered similar list question (do.call is your friend)
lll- list(data.frame(a=1:10,b=rnorm(10)),
data.frame(a=1:9,b=rnorm(9)+5))
mat - sapply(lll, dim)
plot(do.call(rbind,lll), pch=rep(1:dim(mat)[2],
times=as.numeric(mat[1,])))
HTH
Petr
On 8 Dec 2005 at 17:59, Judy Chung
Hi
you see the differenc between factors and numbers.
columns with NA are factors
columns with NA ar numeric
you can see it by
str(chemicS) which will reveal a structure of your data
So either change factors by
as.numric(as.character())
or read it with forcing columns to numeric
Ulrich Leopold [EMAIL PROTECTED] writes:
Dear list,
I am using R 2.1.1 on a Fedora 3 Linux, 32 bit PC.
If I compute the aggregated mean and the standard deviation I get
standard deviation values for factors where the mean was not computed.
It seems to me that this is somehow related to
Or use lattice:
x - list(data.frame(a = 1:10, b = rnorm(10)),
data.frame(a = 1:9, b = rnorm(9) + 5))
## create grouping variable
g - rep(seq(along = x), sapply(x, nrow))
## if `x' has names then replace by
## g - rep(names(x), sapply(x, nrow))
z - cbind(do.call(rbind, x), g = g)
Prof Brian Ripley a écrit :
I had already posted this in this thread: it is in sections 3.1
and Appendix B of `Writing R Extensions'.
Dear Prof Ripley,
I am certainly missing something. I did read
http://cran.r-project.org/doc/manuals/R-exts.html#Tidying-R-code
which is section 3.1 of
Hi, there is a quote in the fortunes package:
To paraphrase provocatively, `machine learning is statistics minus any
checking
of models and assumptions'.
-- Brian D. Ripley (about the difference between machine learning and
statistics)
useR! 2004, Vienna (May 2004)
Was this
Dear useRs!
I would like to list all possible samples of size n form a population of
size N. Obviously, N must be small (up to 20??) for this to be possible.
For example, let say that N = 3 and n = 2. Therefore, we can say we have
units 1, 2 and 3. I believe all possible samples are :
Dear useRs!
I would like to generate a list of all possible (unique) partitions of N
units into k classes. For example, all possible partitions of 4 units into 2
classes are (I hope I have not missed anyone):
1,1,1,2 (this can be read as {1,2,3},{4})
1,1,2,1
1,2,1,1
2,1,1,1
1,1,2,2
Rajarshi Guha [EMAIL PROTECTED] writes:
Hi, there is a quote in the fortunes package:
To paraphrase provocatively, `machine learning is statistics minus any
checking
of models and assumptions'.
-- Brian D. Ripley (about the difference between machine learning and
statistics)
Please stop sending the same message over and over again (I see it 3 times
in the archive), using HTML mail which we specifically ask you not to in
the posting guide.
You are using a bandwidth selector for density() with ksmooth().
You seem still not to have read the help page for ksmooth,
RSPerl is an omegahat project. Just a quick question--I am playing with
RSPerl (MacOS X, R2.2.0,perl 5.8.6, RSPerl 0.8.0). Quite cool! I am
interested in taking a two-D array in perl and calling a function in R on
it. Is there a way to pass the array across to R without it being coerced
to the
On 08-Dec-05 Ales Ziberna wrote:
Dear useRs!
I would like to list all possible samples of size n form a
population of size N. Obviously, N must be small (up to 20??)
for this to be possible.
For example, let say that N = 3 and n = 2. Therefore, we can
say we have units 1, 2 and 3. I
Not sure whether or not this is a good idea but note that
the techniques discussed in the recent thread:
Change labels of x-axes in Plot of stl() function?
can be used here too. e.g.
library(proto)
kronecker - function(...) {
outer - function(x, y, FUN, sep) {
Hello,
I am having difficulties creating lower case Greek letters.
For example
plot(0,0, type = n)
text(-0.5,1, expression(beta) )
text( 0.5,1, expression(alpha) )
produce the upper case letters B and A.
Running
demo(plotmath)
In the Symbolic Names
Alpha - Omega ! 7
alpha - omega
I would like to thank Ted Harding and Kristel Joossens for their replies!
They both work perferctly.
I would also like to appologize for not finding the package combinat myself!
Thank you aggain,
Ales Ziberna
- Original Message -
From: Ted Harding [EMAIL PROTECTED]
To: Ales Ziberna
combinations in the gtools package can be helpfull here,
best, ingmar
From: Ales Ziberna [EMAIL PROTECTED]
Date: Thu, 8 Dec 2005 15:45:37 +0100
To: R-help r-help@stat.math.ethz.ch
Subject: [R] Finding all possible partitions of N units into k classes
Dear useRs!
I would like to
On Thu, 8 Dec 2005, Matt Pocernich wrote:
I am having difficulties creating lower case Greek letters.
For example
plot(0,0, type = n)
text(-0.5,1, expression(beta) )
text( 0.5,1, expression(alpha) )
produce the upper case letters B and A.
Running
demo(plotmath)
In the Symbolic
Having no idea what the object no is, or what the object off_set
is, it is difficult to understand what you are trying to do. Perhaps
if you substituted simple numbers in the example, such as
tab[ 1:5, 15]
it would be easier to understand.
Perhaps what you really want is cbind() or
There is a subplot command in the latest version of the TeachingDemos
package (version 1.1 available today) that does what you want using
traditional graphics (others have given suggestions using grid
graphics). An example:
x - 0:10
y - x^4
plot(x,y,xaxs='i',yaxs='i')
subplot(
On 08-Dec-05 Ales Ziberna wrote:
Dear useRs!
I would like to generate a list of all possible (unique)
partitions of N units into k classes. For example, all possible
partitions of 4 units into 2 classes are (I hope I have not
missed anyone):
1,1,1,2 (this can be read as {1,2,3},{4})
Can anyone please help me understand whats happening here?
Thanks
Tom
getAmpRatio-function(v_amps){
#calculates the amplitude ratios between the 3 largest amps and the
rest
bigamp-0
map-rep(TRUE,length(v_amps))
for(iLoc in 1:3){
bigamp-bigamp+max(v_amps)
Again (as earlier last week) it happened that some of the
postings to R-help were using a version of unicode that seemed
invalid to the unicode-handler (for the digest) inside Mailman (the mailing list
software). As a consequence, yesterday's and today's daily
digests were not sent out.
This
Folks,
I was drawn to R, like many others, partly for the opportunity
to draw nice, colorful graphs (occasionally ones with meaning, too :-)
). I am still quite a newbie to R.
As such, I have been trying to understand the code for the graphics on
the home page (the ones from the 2004
Is there or will there be an implementation of sequential patterns (temporal
association rules) for R?
Kind regards
christoph
[[alternative HTML version deleted]]
__
R-help@stat.math.ethz.ch mailing list
Hallo everybody,
I am doing a thesis in video extensometry and one my
approaches requires peak detection in a two
dimensional data.
If would be grateful if anyone can throw some light on
this for me by giving me some hints on how to do it or
give me some links for it.
thank very much in
Hi,
In the example below why is d 10 times bigger than m, according to
object.size ? It also takes around 10 times as long to create, which fits
with object.size() being truthful. gcinfo(TRUE) also indicates a great deal
more garbage collector activity caused by data.frame() than matrix().
$ R
On Thu, Dec 08, 2005 at 06:47:05AM -0500, tom wright wrote:
Can anyone please help me understand whats happening here?
Thanks
Tom
getAmpRatio-function(v_amps){
#calculates the amplitude ratios between the 3 largest amps and the
rest
bigamp-0
map-rep(TRUE,length(v_amps))
Hello,
Have you tried to ask its author directly (Eric Lecoutre
[EMAIL PROTECTED])?
Best,
Philippe Grosjean
Satsangi, Vivek wrote:
Folks,
I was drawn to R, like many others, partly for the opportunity
to draw nice, colorful graphs (occasionally ones with meaning, too :-)
). I am
tom wright wrote:
Browse[1] mean(amps[1],amps[2],amps[3],amps[7],amps[8])
[1] 1
For starters, this just returns mean(amps[1]). 'mean' computes the
mean of the first argument, the others are slurped up by '...' and in
this case thrown into the bin. You want to do
Thanks for the answers, yup the missing c() was what was throwing me.
And thanks Barry for the slighly more elegant code, I'm a bit post
christmas party here and not thinking as straight as I should be.
On Thu, 2005-08-12 at 06:47 -0500, tom wright wrote:
Can anyone please help me understand
Matthew Dowle [EMAIL PROTECTED] writes:
Hi,
In the example below why is d 10 times bigger than m, according to
object.size ? It also takes around 10 times as long to create, which fits
with object.size() being truthful. gcinfo(TRUE) also indicates a great deal
more garbage collector
On Tuesday 06 December 2005 14:41, JeeBee wrote:
[...]
N = 4
input_numbers = seq((2^N)-1, 0, -1)
# convert to binary matrix
input_mat = NULL
for(i in seq(N-1,0,-1)) {
new_col = input_numbers %% 2
input_mat = cbind(new_col, input_mat)
input_numbers = (input_numbers - new_col) / 2
}
Le 08.12.2005 18:37, Satsangi, Vivek a écrit :
Folks,
I was drawn to R, like many others, partly for the opportunity
to draw nice, colorful graphs (occasionally ones with meaning, too :-)
). I am still quite a newbie to R.
As such, I have been trying to understand the code for the graphics
See Also
http://finzi.psych.upenn.edu/R/library/caTools/html/combs.html
Jarek Tuszynski
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Sent: Thursday, December 08, 2005 11:19 AM
To: Ales Ziberna
Cc: R-help
Subject: Re: [R] Finding all possible partitions of N
Dear R-users,
I would like to know if there is any way to constraints optimized parameters
using the function lm, glm or others that are written in the form:
Lm( formula, data ...)
As I understand, formula are of the type y ~ X1 +X2+ ... Xi (where Y, X1, X2
..Xi are vectors). In my case I would
I'm creating a package for my own use that uses some S4 classes but no
methods.
I have a file called NAMESPACE it contains the line:
exportClasses(foo)
and at the top of the R file I have
setClass(foo, representation(x=numeric)
and the line:
.onLoad-function(libname,pkgname)
When I run R
Dear R-help
We have a regression problem which could be solved elegantly if we could
figure out how to get the R residuals() function to accept missing
dependent variables.
We have ~2 gene-expression vectors y, each being measured on the
same set of individuals, but each having a small
Hello, R Users,
I have a list (say listexp) of 10,000 elements, each of which consists of a
matrix (5X6). It likes:
$a
trt1rep1trt1rep2trt2rep1trt2rep2ctlrep1ctlrep2
[1,] 5054 98 8940 45
[2,] 6065 76 79
Just noticed the mssing ) at the end of the setClass statement, it is there
in the orginal
Phineas
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of BBK
Sent: Thursday, December 08, 2005 8:18 PM
To: 'R-Help
Subject: [R] Loading namespaces
I'm creating a
I have a data table with 712 cases (rows) describing young peoples activities
for 72 months each case has been classified into one
of 5 clusters.
The first 72 columns are monthly activities coded 1 to 6 (e.g. school =1) and
the 73rd column is the cluster number of the case.
I wish to
Hello, Everyone,
I am sorry that my message got truncated.
I resend it again as below:
Hello, R Users,
I have a list (say listexp) of 10,000 elements, each of which consists of a
matrix (5X6). It likes:
$a
trt1rep1trt1rep2trt2rep1trt2rep2ctlrep1ctlrep2
[1,] 5054
Hello, Everyone,
I am sorry that my message got truncated due to wrong format.
I hope it works now:
Hello, R Users,
I have a list (say listexp) of 10,000 elements, each of which consists of a
matrix (5X6). It likes:
$a
trt1rep1trt1rep2trt2rep1trt2rep2ctlrep1ctlrep2
[1,]
Hi all.
I would like to use the rbga.bin function (from the genalg package) as
part of a model selection process to whittle down a list of ~40
potential explanatory variables to only the most important ones.
Unfortunately, despite my working knowledge of R for linear modeling and
basic
BBK schrieb:
Just noticed the mssing ) at the end of the setClass statement, it is there
in the orginal
Phineas
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of BBK
Sent: Thursday, December 08, 2005 8:18 PM
To: 'R-Help
Subject: [R] Loading namespaces
I'm
I am analyzing a 1-to-2 matched case-control study using clogit in the
survival package. I am interested in comparing and assessing fit of
non-nested models. I don't want to program all the diagnostics
described in Hosmer/Lemeshow (2000). Can someone proficient with clogit
and assessing fit for
Ram,
See excelent thread here last month.
Search for finding peaks
On 12/8/05, SHRIRAM R SAMPAT [EMAIL PROTECTED] wrote:
Hallo everybody,
I am doing a thesis in video extensometry and one my
approaches requires peak detection in a two
dimensional data.
If would be grateful if anyone can
I am trying to automatically construct a distance function from
a training set in order to use it to cluster another data set.
The variables are nominal. One variable is a class variable
having two values; it is kept separate from the others.
I have a method which constructs a distance matrix
I've just answered a similar question from Richard O'Keefe.
MASS p.445 shows you how to do this for logistic regression, and the
example is easy to modify.
On Thu, 8 Dec 2005, Devred, Emmanuel wrote:
Dear R-users,
I would like to know if there is any way to constraints optimized parameters
On Fri, 9 Dec 2005, Richard A. O'Keefe wrote:
I am trying to automatically construct a distance function from
a training set in order to use it to cluster another data set.
The variables are nominal. One variable is a class variable
having two values; it is kept separate from the others.
I
How do you propose to forecast? If it were me, I'd first worry about
what to use to model, then the forecasting. I'd start with normal
probability plots to make sure I didn't have any outliers, need a
transformation, etc. If all looked plausibly normally distributed, I
might first
Rainer M Krug writes:
Thorsten Wiegand used in his paper Wiegand T., and K. A. Moloney 2004.
Rings, circles and null-models for point pattern analysis in ecology.
Oikos 104: 209-229 a statistic he called O-Ring statistic which is
similar to Ripley's K, only that it uses rings instead
Dear Madams/Sirs,
Hello. I am using the gls function to specify an arma correlation during
estimation in my model. The parameter values which I am sending the
corARMA function are from a previous fit using arima. I have had some
success with the method, however in other cases I get the
I have a large matrix and want to create a 3d surface of it.
Suppose the matrix looks something like Matrix K:
a-c(1:1200)
b-c(rep(1:30,40))
c-c(a+b^2)
K-data.frame(a,b,c)
The vector values are not ordered (and repeat themselves as in b).
Whenever I try commands like
There are doubtless tests for kurtosos by itself, though I'm not
familiar with any. When I'm conderned about kurtosis (which is often),
I routinely make normal probability plots of observations and residuals
from model fits. If I see roughly a straight line, I conclude that I
won't
Prof. Pipley
First let me thank you for your help.
Second, you are correct, I should not have used the word error in my subject
line.
Regarding the lack of detach(), I simply forgot to include that in my email.
The warnings regarding the incomplete final line do not seem to want to go
away.
The
Frank Johannes wrote:
I have a large matrix and want to create a 3d surface of it.
Suppose the matrix looks something like Matrix K:
a-c(1:1200)
b-c(rep(1:30,40))
c-c(a+b^2)
K-data.frame(a,b,c)
The vector values are not ordered (and repeat themselves as in b).
79 matches
Mail list logo