Is there any way to set options during the evaluation of a particular
expression, with them automatically reset when control leaves that
expression, however that happens? Kind of like let on a special
variable does in Lisp. I naively tried
with(options(warn=-1), {
fit - fitdistr(data,
Hi,
I can use runif to generate 1 dimensional random variables,
assume the dimesion of the random variable is 2, X(x1, x2), how do I
generate the 2 dimensional random variable with normal distribution?
Do I need to both a mean vector and variance covariance matrix?
Thanks
Pat
Am 16 May 2007 um 23:20 hat Patrick Wang geschrieben:
Date sent: Wed, 16 May 2007 23:20:25 -0700 (PDT)
From: Patrick Wang [EMAIL PROTECTED]
To: r-help@stat.math.ethz.ch
Subject:[R] How to generate two dimensional random variable
?on.exit
But here, you want suppressWarnings.
On Wed, 16 May 2007, Zack Weinberg wrote:
Is there any way to set options during the evaluation of a particular
expression, with them automatically reset when control leaves that
expression, however that happens? Kind of like let on a special
hie R users
l have the following matrix
n=20
m-matrix(nrow=n,ncol=4)
colnames(m)=c(treatmentgrp,strata,survivalTime)
for(i in 1:n)
m[i,]-c(sample(c(1,2),1,replace=TRUE),sample(c(1:2),1,replace=TRUE),rexp(1,0.07),rexp(1,0.02))
hie R users
l have the following matrix
n=20
m-matrix(nrow=n,ncol=4)
colnames(m)=c(treatmentgrp,strata,survivalTime)
for(i in 1:n)
I encountered this problem about 18 months ago. I contacted Prof. Fox
and Dr. Malewski (the R package maintainers for mice) but they referred
me to Prof. van Buuren. I wrote to Prof. van Buuren but am unable to
find his reply (if he did reply).
Here are the functions I used at that time, if
1) Your colnames need 4 elements and not 3
2) Utilize the argument 'n' in your random number generators
Your codes could be simplified as:
m - cbind( treatmentgrp = sample( 1:2, n, replace=T ),
strata= sample( 1:2, n, replace=T ),
survivalTime = rexp( n,
Basically, I’m trying to install rJava on my windows XP machine. I think I
have succeeded in doing so as it appears in the list when i type library()
in R.
However, when i type ‘library(rJava)’ I get an error dialog box saying:
'This application has failed to start because jvm.dll was not
mister_bluesman wrote:
Basically, I’m trying to install rJava on my windows XP machine. I think I
have succeeded in doing so as it appears in the list when i type library()
in R.
However, when i type ‘library(rJava)’ I get an error dialog box saying:
'This application has failed to
Hi, everybody,
3 questions about R-square:
-(1)--- Does R2 always increase as variables are added?
-(2)--- Does R2 always greater than 1?
-(3)--- How is R2 in summary(lm(y~x-1))$r.squared
calculated? It is different from (r.square=sum((y.hat-mean
Ah thanks for that. That seems to have done the trick. But I'm not sure
whether I have copied the right jvm.dll file into the path.
I have 3:
~\Java\jre1.6.0_01\bin\client -this is the one i copied
~\Java\jdk1.6.0_01\jre\bin\client
~\Java\jdk1.6.0_01\jre\bin\server
Did I copy the
On 17/05/2007 7:02 AM, ??? wrote:
Hi, everybody,
3 questions about R-square:
-(1)--- Does R2 always increase as variables are added?
-(2)--- Does R2 always greater than 1?
-(3)--- How is R2 in summary(lm(y~x-1))$r.squared
calculated? It
mister_bluesman wrote:
Ah thanks for that. That seems to have done the trick. But I'm not
sure whether I have copied the right jvm.dll file into the path.
I have 3 places where a jvm.dll file can be found:
~\Java\jre1.6.0_01\bin\client -this is the one i copied
I am currently using S+, which is my company standard econometric package,
but unfortunately in some areas R has a lot more to offer in nice
functions/libraries. Libraries I would like to use in S+. So I would like to
use the R functions by calling on R from S+. For example export the data to
be
I have been having some difficulty instaling RWinEdt 1.7-5
I've tried a couple methods, including installing the package from a zip
file that I've downloaded locally.
It installs fine, but then I get an error message with library(RWinEdt) as
follows:
library(RWinEdt)
Error in getWinEdt() :
On 5/16/07, Thomas Adams [EMAIL PROTECTED] wrote:
Marc,
That did it! Thank you so much for your help…
Regards,
Tom
Marc Schwartz wrote:
On Wed, 2007-05-16 at 16:34 -0400, Thomas Adams wrote:
I am generating a single graphic containing about 31 Boxplots; the issue
I am having is
Hallo!
I have two groups (placebo/verum), every subject is measured at 5 times, the
first time t0 is the baseline measurement, t1 to t4 are the measurements after
applying the medication (placebo or verum). The question is, if there is a
significant difference in the two groups and how large
John:
Thanks for your reply, I spent some time on this and the conclusion is
it works:
top- tktoplevel()
mainFrame - tkcanvas(top)
both top and mainFrame can be used as parameters to pass to other
function. The name, however, will conflict each other if they are
defined in the same
Karl Knoblick wrote:
Hallo!
I have two groups (placebo/verum), every subject is measured at 5 times, the
first time t0 is the baseline measurement, t1 to t4 are the measurements
after applying the medication (placebo or verum). The question is, if there
is a significant difference in the
The new version of S+ (version 8.0) is supposed to be able to read R
code unmodified. Insightful is supposedly spending a ton of time making
S+ able to use all R code without modification. It must be taking them
longer than expected because I though it was supposed to be released by
the second
Andrew Yee wrote:
I have been having some difficulty instaling RWinEdt 1.7-5
I've tried a couple methods, including installing the package from a zip
file that I've downloaded locally.
It installs fine, but then I get an error message with library(RWinEdt) as
follows:
library(RWinEdt)
Bos, Roger wrote:
The new version of S+ (version 8.0) is supposed to be able to read R
code unmodified. Insightful is supposedly spending a ton of time making
S+ able to use all R code without modification. It must be taking them
longer than expected because I though it was supposed to be
On Wed, 16 May 2007, Zack Weinberg wrote:
Is there any way to set options during the evaluation of a particular
expression, with them automatically reset when control leaves that
expression, however that happens? Kind of like let on a special
variable does in Lisp. I naively tried
You
Adai,
Thanks for the functions. I tried using your functions and I get the
same error message during the pooling part:
pool(micefit)
Error in names(df) - names(f) - names : 'names' attribute [5] must be
the same length as the vector [0]
Brant
-Original Message-
From: Adaikalavan
Thanks. I mistakenly didn't realize that I needed to have WinEdt installed
first!
Now that it's installed, the installation works fine.
Andrew
On 5/17/07, Uwe Ligges [EMAIL PROTECTED] wrote:
Andrew Yee wrote:
I have been having some difficulty instaling RWinEdt 1.7-5
I've tried a
Could someone please tell me where I can find a simple example, which does
not require linux!, on how I can see if this is working and get me started
using rJava. I have read the document 'Getting Started with the
R-Java/Omegahat Interface' and have tried to type in things such as
I am running a very long loop and would like to save intermediate
results in case of a system or program crash. Here is the skeleton of
what my code would be:
for (i in 1:zillion)
{
results[[i]]-do.something.function()
if (logical.test(i)) {save(results, results.tmp)}
}
if (i %% 1000 == 0)
b
On May 17, 2007, at 10:56 AM, Mark W Kimpel wrote:
I am running a very long loop and would like to save intermediate
results in case of a system or program crash. Here is the skeleton of
what my code would be:
for (i in 1:zillion)
{
Mark W Kimpel wrote:
I am running a very long loop and would like to save intermediate
results in case of a system or program crash. Here is the skeleton of
what my code would be:
for (i in 1:zillion)
{
results[[i]]-do.something.function()
if (logical.test(i))
Dear Hao,
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 17, 2007 8:29 AM
To: John Fox
Cc: r-help@stat.math.ethz.ch
Subject: Re: [R] Is it possible to pass a Tcl/Tk component as
argument to afunction
John:
Thanks for your reply, I
On 5/17/2007 10:56 AM, Mark W Kimpel wrote:
I am running a very long loop and would like to save intermediate
results in case of a system or program crash. Here is the skeleton of
what my code would be:
for (i in 1:zillion)
{
results[[i]]-do.something.function()
if
Mark W Kimpel wrote:
I am running a very long loop and would like to save intermediate
results in case of a system or program crash. Here is the skeleton of
what my code would be:
for (i in 1:zillion)
I'm a bit worried about this line:
1:zillion
Error: cannot allocate vector of
New to R; please excuse me if this is a dumb question. I tried to RTFM;
didn't help.
I want to do a series of regressions over the columns in a data.frame,
systematically varying the response variable and the the terms; and not
necessarily including all the non-response columns. In my case, the
Try this:
lm(Sepal.Length ~., iris[1:3])
# or
cn - c(Sepal.Length, Sepal.Width, Petal.Length)
lm(Sepal.Length ~., iris[cn])
On 5/17/07, Chris Elsaesser [EMAIL PROTECTED] wrote:
New to R; please excuse me if this is a dumb question. I tried to RTFM;
didn't help.
I want to do a series of
On 5/15/07, Jose Quesada [EMAIL PROTECTED] wrote:
Hi,
I'm finding that readMM() cannot read a file written with writeMM().
Example:
library(Matrix)
a = Matrix(c(1,0,3,0,0,5), 10, 10)
a = as(a, CsparseMatrix)
writeMM(a, kk.mm)
b = readMM(kk.mm)
Error in validObject(.Object) : invalid
tmp - data.frame(matrix(rnorm(40),10,4, dimnames=list(NULL,
c(Y,A,B,C
tmp
tmp.form - paste(names(tmp)[1], paste(names(tmp)[-1], collapse= + ),
sep= ~ )
tmp.form
lm(tmp.form, tmp)
The R language is powerful enough to most of the lisp-like things
you may want to do.
Rich
System: Fedora Core 5
R: 2.2.1 and 2.4.1, complied from source
gcc: 4.1.1
I'm trying to pass a single precision array to some legacy code. I
ultimately got the code working by ignoring part of the help
documentation. The code is actually in Fortran, but the following C
program illustrates
mister_bluesman wrote:
Could someone please tell me where I can find a simple example, which does
not require linux!, on how I can see if this is working and get me started
using rJava. I have read the document 'Getting Started with the
R-Java/Omegahat Interface' and have tried to type in
... and note that if a matrix of responses is on the left of ~ , separate
regressions will be simultaneously fit to each of the columns of the matrix.
Note that this **is** in TFM -- ?lm.
Bert Gunter
Genentech Nonclinical Statistics
-Original Message-
From: [EMAIL PROTECTED]
l would like to create the following matrice
treatmentgrpstrata
11 11 11 12
12 12 21 21 21
22 22 22 l
Several years ago, I wrote an R package RinS
which embeds R in S-Plus as a regular chapter
and then allowed one to call R functions from S-Plus
in the form
.R('rfunction', x, y, z)
I haven't looked at it for a long time, but the basic
architecture should still work. What might need to be
Hi Uwe,
Thanks for the answer, but I still need a bit more clearification. I always
thought that a .rnw or .snw file is a file mixing word processing markup
(e.g. tex or HTML) and R/S code using noweb syntax. Is the reason for
'Stangle' is not working with .rnw file with HTML due to there is
How does one go about doing a repeated measure regression? The
documentation I have on it (Lorch Myers 1990) says to use linear /
(subj x linear) to get your F. However, if I put subject into glm or
lm I can't get back a straight error term because it assumes
(rightly) that subject is a
R version 2.5.0, under gentoo linux. This may be just my ignorance
about naming conventions inside loops and subsets, but the following
appears like a bug to me.
y = c( 1963, 1963, 1964, 1964, 1965, 1965 );
r1= rnorm(6);
d= data.frame ( y=y, r1=r1 );
## note: I am not attach()ing anything
Ah ok, thanks. However (again!), when i try to strat the jvm using .jinit() I
don't seem to be able to as I get the message:
Error in .jinit() : Cannot create Java Virtual Machine
What is going on here?
Thanks again.
mister_bluesman wrote:
Basically, I’m trying to install rJava on my
In the 'subset' function, the 'select' parameter can contain the names of
the columns (without the df$ qualifier). So in your 'for' loop you
basically have
subset(d, d$y ==d$y)
which selects all the data since you have a column name of 'y' which is the
same as your variable.
On 5/17/07, ivo
Dear Group:
I am working with a data frame containing 316 rows of individuals
with 79 variables. Each of these 79 variables have values that range
between -4 to +4, and I want to subset this data frame so that in the
resulting new dataframe, values of _all_ of these variables should
range
Try this:
subj1 - cbind(-4, -3, -1, -5, -7)
subj2 - cbind(-2, -1, -1, -2, +2)
subj3 - cbind(+2, +1, +2, +1, +2)
subj4 - cbind(-4, -1, -2, +2, +1)
mydf - as.data.frame(rbind(subj1, subj2, subj3, subj4))
mydf
V1 V2 V3 V4 V5
1 -4 -3 -1 -5 -7
2 -2 -1 -1 -2 2
3 2 1 2 1 2
4 -4 -1 -2 2 1
You need to gain some background. MIXED EFFECTS MODELS in S and S-PLUS by
Pinheiro and Bates is a canonical reference for how to do this with R.
Chapter 10 of Venables and Ripley's MASS(4th ed.) contains a more compact
but very informative overview that may suffice. Other useful references can
Arin Basu wrote:
Dear Group:
I am working with a data frame containing 316 rows of individuals
with 79 variables. Each of these 79 variables have values that range
between -4 to +4, and I want to subset this data frame so that in the
resulting new dataframe, values of _all_ of these
Hi,
i am trying to use mix package for unrestricted general location model
and multi-imputation on a dataset. While I am quite confident that data
are ready, I receive errors on prelim.mix() step.
My dataset is actually a data matrix with 365 obs and 11 vars. 10 vars
are qualitative (ex-factor
ahh...it is the silent substitution of the data frame in the subset
statement. I should have known this. (PS: this may not be desirable
behavior; maybe it would be useful to issue a warning if the same name
is defined in an upper data frame. just an opinion...)
mea misunderstanding.
/iaw
See my response to your thread controling the size of vectors in a
matrix. Please do not create multiple threads on the same day asking
basically the same question, especially if you cannot substantially
improve the clarity and quality of the post.
Multiple threads asking the same question
Are you sure you used my pool function? Because as I just have
discovered, it had a minor typo in the code. After replacing
df - (m - 1) * (1 + 1/r)2 with df - (m - 1) * (1 + 1/r)^2 in my
pool() function, I get
library(survival); data(pbc)
d - pbc[,c('time', 'status', 'age', 'sex',
... but it **is** explicitly documented in ?subset:
For data frames, the subset argument works on the rows. Note that subset
will be evaluated in the data frame, so columns can be referred to (by name)
as variables in the expression (see the examples).
Bert Gunter
Genentech Nonclinical
of course it is. virtually everything in R is somewhere documented,
and once one sees it, pretty well documented, too.
my suggestion for a warning is more a matter of user
friendliness---a warning, not an error. chances are that if a
variable exists in the upper frames, and a user reuses it,
Hi, this is simple,
I've generated a bivariate normal distribution with a known correlation.
I want to plot the density function with p(y,x) on the vertical axis
and x, and y on the horizontal axes. How is that done? Thanks in advance!
library(MASS)
mu - c(0,1) # mean vector
sigma -
Hello there.
When I try to start the jvm using .jinit() after loading library(rJava) I
don't seem to be able to as I get the message:
Error in .jinit() : Cannot create Java Virtual Machine
What is going on here? I have java 1.6 installed on my XP machine
Thanks again.
--
View this
On 5/17/2007 3:42 PM, David Kaplan wrote:
Hi, this is simple,
I've generated a bivariate normal distribution with a known correlation.
I want to plot the density function with p(y,x) on the vertical axis
and x, and y on the horizontal axes. How is that done? Thanks in advance!
Thanks Adai, I got it to work. You were right, I had called the wrong
pool function.
Brant
-Original Message-
From: Adaikalavan Ramasamy [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 17, 2007 1:56 PM
To: Inman, Brant A. M.D.
Cc: r-help@stat.math.ethz.ch
Subject: Re: [R] MICE for Cox
My sessioninfo is below and I have two questions about loading packages
in R :
#===
=
R version 2.4.0 (2006-10-03)
i686-pc-linux-gnu
locale:
C
attached base
Hi,
I have two matrices, A (axd) and B (bxd). I want to get another matrix C (axb)
such that, C[i,j] is the Euclidean distance between the ith row of A and jth
row of B. In general, I can say that C[i,j] = some.function (A[i,], B[j,]).
What is the best method for doing so? (assume a b)
I
Hi,
I have a fresh install of R 2.5.0, I then installed the pls package.
When trying to load this package I get:
library(pls)
Attaching package: 'pls'
The following object(s) are masked from package:stats :
loadings
Searches show this to most often be related to
Hi,
I have a vector contains values 1,2,3.
Can I call a function split to split it into 3 vectors with 1 corresponds
to value ==1, which contain all the indexes for value==1.
2 corresponds to value ==2 which contain all the indexes for value=2
Thanks
pat
Dear colleagues,
I have an image which I can display in the greyscale using image. On this
image, for some pixels, which I know, I want to display their activity based on
a third measure. One way to do that would be to color these differently, and
use an opacity measure to display the third
If temp is your vector then split(index(temp),temp) will give you what
you want.
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Patrick Wang
Sent: Thursday, May 17, 2007 8:15 PM
To: r-help@stat.math.ethz.ch
Subject: [R] Split a vector(list) into 3 list
it's not really an error but it changes how you call things depending
on what you need. If you want to use loadings in stats,
you will have to use it by saying stats::loadings because it's masked
and then
you use loadings from pls by just saying loadings. Other than that,
there's no problem I
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Ron Crump
Sent: Thursday, May 17, 2007 5:03 PM
To: r-help@stat.math.ethz.ch
Subject: [R] Problem loading library
Hi,
I have a fresh install of R 2.5.0, I then installed the pls package.
When
Dear Friends,
I'm trying to learn to how to get Bootstrapped standard errors for estimated
coefficients from a regression.
For instance suppose I have the following model
logitmodel - glm (y~X1+X2+X3, family=binomial(link=logit))
beta - logitmodel$coef
can somebody please guide me on how to
Thanks,
no index function was defined in R.
I try to use the split(order(temp), temp), the number of groups are
correct, however the result doesnot seem to be correct. I try to match
before the ordered index and the original index.
Pat
If temp is your vector then split(index(temp),temp) will
On Thu, 2007-05-17 at 17:14 -0700, Patrick Wang wrote:
Hi,
I have a vector contains values 1,2,3.
Can I call a function split to split it into 3 vectors with 1 corresponds
to value ==1, which contain all the indexes for value==1.
2 corresponds to value ==2 which contain all the indexes
index is definitely defined in my version ( 2.4.0) because when I do
?index, I get info. Maybe you
Are using an older or younger version of R ? I'm really not sure why you
are experiencing that problem.
-Original Message-
From: Patrick Wang [mailto:[EMAIL PROTECTED]
Sent: Thursday, May
On Thu, 2007-05-17 at 17:43 -0700, Anup Nandialath wrote:
Dear Friends,
I'm trying to learn to how to get Bootstrapped standard errors for
estimated coefficients from a regression.
For instance suppose I have the following model
logitmodel - glm (y~X1+X2+X3,
Hi All
How can I fit a repeated measures analysis using gls? I want to start with a
unstructured correlation structure, as if the the measures at the occations are
not longitudinal (no AR) but plainly multivariate (corSymm).
My data (ignore the prox_pup and gender, occ means occasion):
This is a dumb question, but I'm having trouble finding the answer to this.
I'd like to do the following:
x-asdf
and then have
the object x.y become automatically converted/represented as asdf.y (sort of
akin to macro variables in SAS where you would do:
%let x=asdf and do x..y)
What is the
Don't need to upgrade R just to get index() working. You can try the
following modification.
v - sample(1:3, 30, replace = TRUE)
split( 1:length(v), v )
Should do the trick. Check out the reverse function unsplit().
Regards, Adai
Leeds, Mark (IED) wrote:
index is definitely defined in
Can you check if the following gives you what you want?
tmp - rbind( A, B )
dis - dist( tmp )
nA - nrow(A)
nB - nrow(B)
dis[ 1:nA, nA + 1:nB ] ## output
If it works, this suggestion comes with the caveat that it might be
computationally inefficient compared with using
Hi all,
I am wondering if anyone has written (or knows of) a function that
will conduct a goodness-of-fit test for a gamma distribution. I am
especially interested in test statistics have some asymptotic
parametric distribution that is independent of sample size or values
of fitted
Hi, All:
assume I need to generate X from inverse gamma with parameter (k, beta).
should I generate from Y from gamma(-k, beta),
then take X=1/Y?
Thanks
pat
__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE
Hi List,
when loading library(rgl) I get error RGL: GLX extension missing on
server. I have Mesa and xgl installed, but xgl info sais its an highly
experimental code. Does this mean I shouldn't bother for a while with
opengl or are there alternatives?
Any help appreciated
Thanx
Herry
R 2.4.1
Sean Connolly napsal(a):
Hi all,
I am wondering if anyone has written (or knows of) a function that
will conduct a goodness-of-fit test for a gamma distribution. I am
especially interested in test statistics have some asymptotic
parametric distribution that is independent of sample
82 matches
Mail list logo