Displaying 20 results from an estimated 100 matches similar to: "(subscript) logical subscript too long in using apply"
2012 May 23
1
numerical integration
Greetings,
Sorry, the last message was sent by mistake! Here it is again:
I encounter a strange problem computing some numerical integrals on [0,oo).
Define
$$
M_j(x)=exp(-jax)
$$
where $a=0.08$. We want to compute the $L^2([0,\infty))$-inner products
$$
A_{ij}:=(M_i,M_j)=\int_0^\infty M_i(x)M_j(x)dx
$$
Analytically we have
$$
A_{ij}=1/(a(i+j)).
$$
In the code below we compute the matrix
2023 May 12
2
Newbie: Controlling legends in graphs
Hello, I'm trying to create a line graph with a legend, but have no
success controlling the legend. Since nothing I've tried seems to work,
I must be doing something systematically wrong. Can anyone point this
out to me?
Here's my data:
> weights
# A tibble: 1,246 ? 3
Date J K
<date> <dbl> <dbl>
1 2000-02-13 133 188
2
2012 May 23
0
numerical integrals
Greetings,
I encounter a strange problem computing some numerical integrals on [0,oo).
Define
$$
M_j(x)=exp(-jax)
$$
where $a=0.08$. We want to compute the $L^2([0,\infty))$-inner products
$$
A_{ij}:=(M_i,M_j)=\int_0^\infty M_i(x)M_j(x)dx
$$
Analytically we have
$$
A_{ij}=1/(a(i+j)).
$$
In the code below we compute the matrix $A_{i,j}$, $1\leq i,j\leq 5$, numerically
and check against the known
2012 Mar 20
1
How to write and analyze data with 3 dimensions
Suppose I have data organized in the following way:
(P_i, M_j, S_k)
where i, j and k and indexes for sets.
I would like to analyze the data to get for example the following
information:
what is the average over k for
(P_i, M_j)
or what is the average over j and k for P_i.
My question is what would be the way of doing this in R.
Specifically how should I write the data in a csv file
and how do I
2011 Jul 27
1
create a index.date column
Dear
R users,
I
created a matrix that tells me the first day of use of a category by
id.
#Calculate
time difference
test$tdiff<-as.numeric(difftime(as.Date("2002-09-01"), test$ftime, units = "days"))
#
obtain the index date per person and dcategory
index.date.test<-tapply(test$tdiff,
list(test$id, test$rcat), max)
Nonetheless,
at the moment I think will be
2002 Jun 27
1
Building from a source-code library under windows
Dear All,
I have a pair of .cpp and .def file can be compiled using VC++ and works
perfectly well in S-PLUS.
I wanted to do the same for R; so I followed the guidline given in "Building
from a source-code library under Windows" as much as possible and manage to
compile them using VC++ and call it from R. But it gives different answer
from the one called from S-Plus.
I know that I did
2004 Apr 18
2
lm with data=(means,sds,ns)
Hi Folks,
I am dealing with data which have been presented as
at each x_i, mean m_i of the y-values at x_i,
sd s_i of the y-values at x_i
number n_i of the y-values at x_i
and I want to linearly regress y on x.
There does not seem to be an option to 'lm' which can
deal with such data directly, though the regression
problem could be algebraically
2011 Jun 15
1
Reshaping data with xtabs reorders my rows
Dear,
I have a data frame melted from a list of matrices (melt from reshape
package), then I impute some missing values and then want to tabulate
the data again to the array (or list, doesn't matter) of matrices form.
However when using xtabs function it orders my rows alphabetically and
apparently doesn't take "reorder = FALSE" option or anything like it.
Is there anything I
2003 Jul 17
3
univariate normal mixtures
Hello,
I have a concrete statistical question:
I have a sample of an univariate mixture of an unknown number (k) of
normal distributions, each time with an unknown mean `m_i' and a
standard deviation `k * m_i', where k is known factor constant for all
the normal distributions. (The `i' is a subscript.)
Is there a function in R that can estimate the number of normal
distributions k
2023 May 16
0
Newbie: Controlling legends in graphs
Rui, thanks so much for your help. Your explanation and example were
clear and concise. Thanks for taking the time and effort to help me.
-Kevin
On 5/12/23 16:06, Rui Barradas wrote:
> ?s 14:24 de 12/05/2023, Kevin Zembower via R-help escreveu:
>> Hello, I'm trying to create a line graph with a legend, but have no
>> success controlling the legend. Since nothing I've
2006 May 08
2
On the speed of apply and alternatives?
Dear all,
I have to handle a large matrix (1000 x 10001) where in the
last column i have a value that all the preceding values in the same row
has to be compared to.
I have made the following code :
# generate a (1000 x 10001) matrix, testm
# generate statistics matrix 1000 x 4:
qnt <- c(0.01, 0.05)
cmp_fun <- function(x)
{
LAST <- length(x)
smpls <- x[1:(LAST-1)]
real
2023 May 16
0
[External Email] Newbie: Controlling legends in graphs
See below.
On 5/16/23 10:52, Christopher Ryan wrote:
> I"m more of a lattice guy than a ggplot guy, but perhaps this is part of
> the problem:
>
> .....
> ? ? ?geom_point(aes(y = m_K, color = "red")) +? ##### >> you've
> associated "K" with the color red
> ? ? ?geom_smooth(aes(y = m_K, color = "red")) +
>
2001 Oct 03
1
package GeneSOM ?
Hello Rprofessionals,
The SOM-Obj works very well, when i normalize
my data and the plot-function, too !
But i miss or didn't find the possibility , extract the
information from the SOMplot "clusterSize" and "mean" for every cluster as quantitative information ( i.e. the DataFrame with an additional column which
define the calculate clusters from SOM)?
My intention -
2018 May 12
3
(no subject)
hello
for exampl, i have this programme
# Generating data which are right truncated
library(DTDA)
library(splines)
library(survival)
n<-25
X<-runif(n,0,1)
V<-runif(n,0.75,1)
for (i in 1:n){
while (X[i]>V[i]){
X[i]<-runif(1,0,1)
V[i]<-runif(1,0.75,1)
}}
res<-lynden(X=X,U=NA, V=V, boot=TRUE)
attach(res)
temps = time
M_i = n.event
L_t = res
2004 Dec 03
3
Computing the minimal polynomial or, at least, its degree
Hi,
I would like to know whether there exist algorithms to compute the
coefficients or, at least, the degree of the minimal polynomial of a square
matrix A (over the field of complex numbers)? I don't know whether this
would require symbolic computation. If not, has any of the algorithms been
implemented in R?
Thanks very much,
Ravi.
P.S. Just for the sake of completeness, a
2005 Sep 14
1
Random effect model
Dear R-help group,
I would like to model directly following random effect model:
Y_ik = M_ik + E_ik where M_ik ~ N(Mew_k,tau_k^2)
E_ik ~ N(0,s_ik^2)
i = number of study
k = number of treatment
---------------------------------------------------------------------------
I have practiced using the command from 'Mixed -Effects models in S and
S-plus'
2010 Nov 08
1
try (nls stops unexpectedly because of chol2inv error
Hi,
I am running simulations that does multiple comparisons to control.
For each simulation, I need to model 7 nls functions. I loop over 7 to do
the nls using try
if try fails, I break out of that loop, and go to next simulation.
I get warnings on nls failures, but the simulation continues to run, except
when the internal call (internal to nls) of the chol2inv fails.
2018 May 10
0
(no subject)
We need some idea of the problem.
http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example
http://adv-r.had.co.nz/Reproducibility.html
On Thursday, May 10, 2018, 11:07:30 a.m. EDT, malika yassa via R-help <r-help at r-project.org> wrote:
Hello
Do You help me, i have the problem in the package DTDA for ?find the probability of truncation
2018 May 13
0
(no subject)
> On May 12, 2018, at 9:42 AM, malika yassa via R-help <r-help at r-project.org> wrote:
>
>
> hello
> for exampl, i have this programme
> # Generating data which are right truncated
> library(DTDA)
> library(splines)
> library(survival)
> n<-25
> X<-runif(n,0,1)
> V<-runif(n,0.75,1)
> for (i in 1:n){
> while (X[i]>V[i]){
>
2009 May 14
1
automated polynomial regression
Dear all -
We perform some measurements with a machine that needs to be
recalibrated. The best calibration we get with polynomial regression.
The data might look like follows:
> true_y <- c(1:50)*.8
> # the real values
> m_y <- c((1:21)*1.1, 21.1, 22.2, 23.3 ,c(25:50)*.9)/0.3-5.2
> # the measured data
> x <- c(1:50)
> # and the x-axes
>
> # Now I do the following: