Displaying 18 results from an estimated 18 matches for "ericlee100".
2009 Feb 02
2
how to generate multiple random variables that are correlated
Hi.
I have two variables, x and y, that are each normally distributed with
mean 0 and have known standard deviations. The variables also have a
known correlation, so I can represent their correlations in a matrix
like so:
a <- array(c(0.3,0.1,0.1,0.2),c(2,2))
a
Is there an R function that generates random values for my two
variables given the correlation? I'd like to do this for up to
2008 Dec 09
3
difftime
Hi. I'm trying to take the difference in days between two times. Can
you point out what's wrong, or suggest a different function? When I
try the following code, The following code works fine:
a <- strptime(1911100807,format="%Y%m%d%H",tz="GMT")
b <- strptime(1911102718,format="%Y%m%d%H",tz="GMT")
x <- difftime(b, a,
2008 Sep 30
1
merging a list and data frame
Hi,
I'd like to merge the following list and data frame by matching the first
column in the data frame to the first number in each object of the list.
I'd also like the merged object to be a list. Any suggestions? Thanks.
eric
a <- list(c(1,11), c(2,12), c(3,13), c(4,14), c(5,16))
b <- data.frame(1:5, 51:55)
[[alternative HTML version deleted]]
2008 Oct 17
1
find bayesian information criterion for all variable combinations
Hi,
I have data for one dependent variable and multiple independent variables
y = b0 + b1*x1 + b2*x2 + ...
I want to a list of all models that have some subset of the independents
(just x1 x2, and not x3, etc.) and their corresponding BIC values. Is there
a pre-existing function that does this? I saw that you can calculate
individual BIC values using 'lm' and something like
AIC(lm1, k
2008 Nov 08
2
lines, ecdf and colors
Hi. I'm trying to plot two ecdf's on the same graph using two
different colors. I can plot using the same color, but it doesn't
work when I change colors? Any suggestions? Thanks in advance for
your help.
x <- c(0.80, 0.83, 1.89, 1.04, 1.45, 1.38, 1.91, 1.64, 0.73, 1.46)
y <- c(1.15, 0.88, 0.90, 0.74, 1.21)
plot(ecdf(x))
# it works without col='blue', but doesn't
2008 Sep 29
2
adding labels to tapply results
Hi,
How do I get labels onto the output from tapply? I need the labels to merge
the output with another data frame. Thanks.
eric
d <- data.frame(cbind(x=1:3, y=1:10))
a <- with(d, tapply(y, x, sum))
[[alternative HTML version deleted]]
2008 Sep 28
2
using tapply on a data frame in a function
Hello,
I'm trying to use tapply to find group means in a function. It works
outside of a function, but I get the error message from the following code:
"Error in tapply(index, cluster, mean) : arguments must have same length."
Any suggestions? Thanks.
eric
d <- data.frame(cbind(cluster=1:2, value1=1:10, value2=11:20))
d
FindClusterTraits <- function(framename, index){
2008 Oct 01
3
lapply where each list object has multiple parts
Hi. I have a list where each object in the list has multiple parts. I'd
like to take the mean of just one part of each object. Is it possible to do
this with lapply? If not, can you recommend another function? Thanks.
eric
> x1 <- c(0,1,2,3)
> x2 <- c(7,8)
> x3 <- c(2,6,6,8)
> x4 <- c(4,8)
>
> Lst1 <- list(label1 = x1,label2 = x2)
> Lst2 <-
2007 Apr 04
0
to findout maximized log likelihoods by using rlarg.fit (for several r order statistics)
...undu)
>
>
>
----------------------------------------------------------------------
>
> Message: 1
> Date: Tue, 3 Apr 2007 11:58:27 +0200
> From: Adelchi Azzalini <azzalini at stat.unipd.it>
> Subject: Re: [R] bivariate interpolation
> To: "eric lee" <ericlee100 at gmail.com>
> Cc: r-help at stat.math.ethz.ch
> Message-ID:
> <20070403115827.99d67de3.azzalini at stat.unipd.it>
> Content-Type: text/plain; charset=ISO-8859-1
>
> On Tue, 3 Apr 2007 11:43:55 +0200, Adelchi Azzalini
> wrote:
>
> AA> On Mon, 2 Apr 2007 22:...
2008 Oct 15
0
R-help Digest, Vol 67, Issue 31
....html
> and provide commented, minimal, self-contained, reproducible code.
>
--
Jim Holtman
Cincinnati, OH
+1 513 646 9390
What is the problem that you are trying to solve?
------------------------------
Message: 17
Date: Mon, 29 Sep 2008 08:45:46 -0400
From: "eric lee" <ericlee100 at gmail.com>
Subject: [R] adding labels to tapply results
To: r-help at r-project.org
Message-ID:
<4056389d0809290545r592bfa5fl801b188a1d5b0b0a at mail.gmail.com>
Content-Type: text/plain
Hi,
How do I get labels onto the output from tapply? I need the labels to merge
the output with a...
2007 Apr 03
1
bivariate interpolation
Hi. I'm trying to take a data set with two independent and one dependent
variable and enter a x,y value to predict the dependent with a nonparametric
technique. I've been using interpp in the akima package, (windows xp, R
2.4.1), but get values that are orders of magnitude off when the predictors
are slightly out of the range of the data set. Can you recommend a function
for me?
2008 Oct 22
0
ad.test exponential distribution
Hi,
I'm trying to use ad.test or ad2.test to test whether a given data set is
exponential. I see that one of the function inputs is "distn", but I try
"exponential" and 5 other variants, but I still get the error message:
ad.test(test2, distn="exponential", fit=list(estimate = 0.167685), H=NA,
sim=100)
Error in ad.test(test2, distn = "exponential",
2010 Jan 29
1
two sample chi-squared test
Hello,
Can you tell me what R function to use to do a two-sample chi-squared
test? I want to see if two distributions are significantly different
from each other, and I don't specify the theoretical distribution of
either. For example, I have the following fake count data:
x <- sample(1:10,50,replace=TRUE)
y <- sample(1:10,100,replace=TRUE)
I saw chisq.test in the stats package, but
2008 Sep 26
1
data frame column name as a function argument
Hello,
I'd like to pass a column name as the argument for a function, but I'm
getting "NULL" as a return value. Any suggestions? Thanks.
> d <- data.frame(cbind(x=1, y=1:10))
> d
x y
1 1 1
2 1 2
3 1 3
4 1 4
5 1 5
6 1 6
7 1 7
8 1 8
9 1 9
10 1 10
> testing <- function(var) {
+ tst <- d$var[3]
+ tst
+ }
>
> dummy <- testing(y)
2009 May 28
1
maximum over one dimension of a 3-dimensional array
Hi,
I'm running R 2.7.2 on windows XP. I'd like to find the maximum of a
3-d array over it's third index to create a 2-d array. For example:
> x <- array(c(1,2,3,10,11,12,3:8),c(2,3,2))
> x
, , 1
[,1] [,2] [,3]
[1,] 1 3 11
[2,] 2 10 12
, , 2
[,1] [,2] [,3]
[1,] 3 5 7
[2,] 4 6 8
> x1 <- x[,,1]
> x2 <- x[,,2]
>
2009 Sep 15
1
releasing memory when using the ncdf package
Hello,
I'm running R 2.7.2 in a windows XP environment and I run the
following in an R console:
library(ncdf)
nc <-open.ncdf('c:/file.nc')
aa <- get.var.ncdf(nc,'var1')
This works fine, but 'aa' takes up about 100mb and I want to release
the memory after using it. I try:
rm(aa)
close.ncdf(nc)
and look at Windows Task Manager, but the memory hasn't been
2009 Feb 26
2
which zip file is the emulator package?
Hi. I'm trying to run the elliptic package on my computer (windows
platform, version 2.7.2). I downloaded the elliptic package zip file
from
http://lib.stat.cmu.edu/R/CRAN/
and installed it, but it says that it needs the "emulator" package.
Can you tell me where to download this? The only similar package by
name is 'emu_4.0.zip' which is not 'emulator.' I also
2008 Oct 31
3
getting the p-value from lm as a list object
Hi,
I'm trying to get the p-value from the 'lm' regression function as a list
object. For example, I can get r^2 from the following code by entering
summary(fm)$r.squared. Is there a way to get the p-value? If not, is there
a function where I can enter the f-value and degrees of freedom to get the
p-value? Thanks.
x <- c(1,2,3,4,5,6,7,8,9,10)
y <- c(1,2,3,4,4,5,6,8,1,9)
fm