Displaying 20 results from an estimated 2000 matches similar to: "mean and sd of each serial position"
2004 Nov 08
1
plotting lm coeficients with their means
I am trying to write a function that will run a linear
model and plot the regression coeficients with their
corresponding means. I am having two problems. I can
get the plot with the function below, but I am having
trouble labeling the points.
function(y,x1,x2,x3,x4){
outlm<-lm(y~x1+x2+x3+x4)
imp<-as.data.frame(outlm$coef[-1])
meanvec<-c(mean(x1),mean(x2),mean(x3),mean(x4))
2013 Apr 04
5
Help for bootstrapping
I have a set of data for US t-bill returns and US stock returns frm 1980-2012. I am trying to bootstrap the data and obtain the minimum variance portfolio and repeat this portfolio 1000 times. However I am unable to get the correct code function for the minimum variance portfolio. When I tried to enter Opt(OriData+1, 1, 5, 0), I get "error:subscript out of bounds" Please help!
2008 Jul 04
2
create a zero matrix & fill
Dear R user,
I have written a function which returns max,min and variation of a power
(see below)
Power is a given matrix(1,n)
I call the function
>Variation<-VAR(p,(n-deltat))
Now the problem is when I want plot(Results[1],Results[2]). Not possible!
I become the following error (in english it means: Error in
as.double.default(x) :Object cannot be transformed in double)
>
2006 Mar 23
3
Sampling in R
Hi all!
I was wondering if you can help me with a little sampling issue I'm
having in R.
I have a database with 100 observations.
I need to sample n=9 sample size, 200 times (i.e. get 200 samples of
size 9).
N (pop. size) =100
Each sample can't contain the same observation more than one time
(i.e. the program needs to check if the obs. has already been sampled
into the sample -
2007 Dec 28
1
logistic mixed effects models with lmer
I have a question about some strange results I get when using lmer to
build a logistic mixed effects model. I have a data set of about 30k
points, and I'm trying to do backwards selection to reduce the number
of fixed effects in my model. I've got 3 crossed random effects and
about 20 or so fixed effects. At a certain point, I get a model (m17)
where the fixed effects are like this
2008 Mar 26
1
cbind and mean by week
Hi:
I have been able to finally crunch my data by
importing it by week(thank you all for your help),but
here we go again..
Now I'am trying to do it for the the whole year.
Since the
dataset is huge I'm only making a 3 weeks dataframe.
- I want to get the mean of pd by week
- I want to count the number of days by week and bind
it to the existing dataframe(x)
- I want to remove the
2011 Mar 15
4
Element by element mean of a list of matrices
Hi All,
is there any effiective and dense/compact method to calculate the mean of a list of - of course coincident - matrices on an element by element basis? The resulting matrix' [i, j]-th element is the mean of the list's matrices' [i, j]-th elements respectively...
Iterating by for statement is quite straightforward, but I am seeking for a more elegant solution, and my attempt with
2008 Jul 04
1
initialize a matrix
Dear R users,
I'm trying to write a function which returns minimum,maximum,mean of a
vector(power)
I've done the following :
VAR<-function(power,length){
for(i in tml:length)){
tvar[i]<-i
pmean[i]<-mean(power[i:i+deltat])
pmin[i]<-min(power[i:i+deltat])
pmax[i]<-max(power[i:i+deltat])
varmax[i]<-100*(pmax[i]-pmean[i])/pmean[i]
2010 Dec 07
1
Help on loops
Dear R-helpers,
I have a basic question on using loops.
I have a panel data set with different variables measured for "n" firms over "t" time periods. A snapshot of the data is given below
id t X1 X2
1 1 4 3
1 2 9 2
1 3 7 3
1 4 6 6
2 1 6 4
2 2 5 3
2 3 1 1
3 1 9 6
3 2 5 5
thus total
2018 May 03
3
length of `...`
Hi,
It would be great if one of the experts could comment on the
difference between Hadley's dotlength and ...length? The fact
that someone bothered to implement a new primitive for that
when there seems to be a very simple and straightforward R-only
solution suggests that there might be some gotchas/pitfalls with
the R-only solution.
Thanks,
H.
On 05/03/2018 08:34 AM, Hadley Wickham
2018 May 04
1
length of `...`
The one difference I see, is the necessity to pass the dots to the function
dotlength :
dotlength <- function(...) nargs()
myfun <- function(..., someArg = 1){
n1 <- ...length()
n2 <- dotlength()
n3 <- dotlength(...)
return(c(n1, n2, n3))
}
myfun(stop("A"), stop("B"), someArg = stop("c"))
I don't really see immediately how one can
2012 Mar 21
1
enableJIT() and internal R completions (was: [ESS-bugs] ess-mode 12.03; ess hangs emacs)
Hello,
JIT compiler interferes with internal R completions:
compiler::enableJIT(2)
utils:::functionArgs("density", '')
gives:
utils:::functionArgs("density", '')
Note: no visible global function definition for 'bw.nrd0'
Note: no visible global function definition for 'bw.nrd'
Note: no visible global function definition for 'bw.ucv'
2020 May 20
2
Precision of function mean,bug?
Hello R-dev,
Yesterday, while I was testing the newly implemented function pmean in
package kit, I noticed a mismatch in the output of the below R expressions.
set.seed(123)
n=1e3L
idx=5
x=rnorm(n)
y=rnorm(n)
z=rnorm(n)
a=(x[idx]+y[idx]+z[idx])/3
b=mean(c(x[idx],y[idx],z[idx]))
a==b
# [1] FALSE
For idx= 1, 2, 3, 4 the last line is equal to TRUE. For 5, 6 and many
others the difference is small
2002 Jun 12
3
help debugging segfaults
(Sorry for the cross-post--- I wasn't sure which list is more
appropriate...)
Hi everyone,
I've run into segfaults when using my randomForest package on large dataset
(e.g., 100 x 15200) and large number of trees (e.g., ntree=7000 and
mtry=3000). I'm wondering if anyone can give me some hints on where to look
for the problem.
The randomForest package mainly consists of two things:
2002 Jun 12
3
help debugging segfaults
(Sorry for the cross-post--- I wasn't sure which list is more
appropriate...)
Hi everyone,
I've run into segfaults when using my randomForest package on large dataset
(e.g., 100 x 15200) and large number of trees (e.g., ntree=7000 and
mtry=3000). I'm wondering if anyone can give me some hints on where to look
for the problem.
The randomForest package mainly consists of two things:
2000 Jun 26
2
nargs() inside "[.myclass"
I am writing a function to work with class I am defining. I have a question
about using nargs() inside of parentheses function. nargs() shows the same
for supplying 1 argument, or no arguments at all. Here is a small example:
> "[.myclass"<-function(x,...) print(nargs()-1)
> x<-c(1,2,3)
> class(x)<-"myclass"
> x[]
[1] 1
> x[1]
[1] 1
> x[1,2]
[1] 2
2003 Oct 10
1
number of arguments in .Call function registration
I initially sent this to the biocore mailing list - but it was
suggested that r-devel would also find it interesting.
Many of us use a macro like
#define CALL_DEF(fname, nargs) { #fname, (DL_FUNC)&fname, nargs}
for use in function registration for use with .Call.
For example, using the example from R Extension manual,
if we want to register a C function myCall with three arguments, we
2010 May 14
2
Subscripting a matrix-like object
I have an S3 class called "tis" (Time Indexed Series) which may or may
not have multiple columns. I have a function "[<-.tis" that I've
reproduced below.
My question is this: inside of "[<-.tis", how can I distinguish between
calls of the form
x[i] <- someValue
and
x[i,] <- someValue ?
In either case, nargs() is 3, and looking at the values
2010 May 14
2
Subscripting a matrix-like object
I have an S3 class called "tis" (Time Indexed Series) which may or may
not have multiple columns. I have a function "[<-.tis" that I've
reproduced below.
My question is this: inside of "[<-.tis", how can I distinguish between
calls of the form
x[i] <- someValue
and
x[i,] <- someValue ?
In either case, nargs() is 3, and looking at the values
2014 Jan 28
2
[LLVMdev] Weird msan problem
Hello everybody,
I've run into some strange behavior with memory sanitizer that I can't
explain and hope somebody with more knowledge of the implementation would
be able to help me out or at least point me into the right direction.
For background, I'm using memory sanitizer to check Julia (julialang.org),
which uses (or at least will once I track down a few bugs) MCJIT for the
code