Displaying 9 results from an estimated 9 matches for "n_1".
Did you mean:
n1
2013 Mar 22
1
Integration of vector syntax unknown
...ure how best to enter the information but here goes...
I'm trying to transfer the following integral into R to solve for ln(gamma_1), on the left, for multiple instances of gamma_i and variable N_i.
gamma_i is, for example, (0, 0.03012048, 0.05000000, 0.19200000, 0.44000000, 0.62566845)
N_i (N_1 or N_2) is between 0 and 1 so that N_1+N_2=1, so if N_1=(0,.166,.180,.250,.325,.374), then N_2=(1.000, 0.834, 0.820, 0.750, 0.675, 0.626)
a_i (a_1 or a_2)
So, for gamma_i (in this case gamma_2), N_i (N_2), and a_i (a_2) first the following
a_i = ln(gamma_i)/(1-N_i)^2
then,
ln(gamma_1) = -a_2*...
2009 Oct 16
1
How odds ratio is computed in fisher.test()?
I'm wondering how odds ratio is computed. I thought that it is
(n11/n12)/(n21/n22), but it is not what fisher.test() computes. Could
somebody let me know?
> n11=3
> n12=1
> n21=1
> n22=3
>
> n1_=n11+n12
> n2_=n21+n22
>
> n_1=n11+n21
> n_2=n12+n22
>
> x=rbind(c(n11,n12),c(n21,n22))
>
> threshold=dhyper(n11,n1_,n2_,n_1)
> probability=dhyper(0:n_1,n1_,n2_,n_1)
> sum(probability[probability<=threshold])
[1] 0.4857143
> (n11/n12)/(n21/n22)
[1] 9
> fisher.test(x)
Fisher's Exact Test...
2010 Sep 08
11
problem with outer
...e length of object [1]
p_11=seq(0,0.3,0.1)
p_12=seq(0.1,0.4,0.1)
guete = function(p_11,p_12) {
set.seed(1000)
S_vek=matrix(0,nrow=N,ncol=1)
for(i in 1:N) {
X_0=rmultinom(q-1,size=1,prob=p_0)
X_1=rmultinom(n-q+1,size=1,prob=cbind(p_11,p_12,(1-p_11-p_12)))
N_0=apply(X_0[,(n-2*k-L+1):(n-k-L)],1,sum)
N_1=apply(X_1[,(n-q-k+2):(n-q+1)],1,sum)
S_vek[i]=((sum(((N_1-k*cbind(p_11,p_12,(1-p_11-p_12)))^2)/k*cbind(p_11,p_12,(1-p_11-p_12))))/(sum(((N_0-k*p_0)^2)/k*p_0)))-1
}
1-mean(f_1<=S_vek & S_vek <=f_2)
}
An other problem i have is when i define
p_11=seq(0,1,0.1)
p_12=seq(0,1,0.1)
then i get...
2010 Nov 27
3
Two time measures
...09/2009;16:50;55717
02/09/2009;16:55;55385
## (and so on to the next day)
I would like to store the intra-day 5-min prices into a list, where each
element would represent one day, something like
list[[1]]
"price at time 1, day 1"
"price at time 2, day 1"
...
"price at time n_1, day 1"
list[[2]]
"price at time 1, day 2"
"price at time 2, day 2"
...
"price at time n_2, day 2"
and so on.
As the "n_1", "n_2", etc, suggest, each day have its own number of
observations (this reflects the fact that the market may open an...
2007 Jul 26
1
significance test for difference of two correlations
Dear R users,
how can I test, whether two correlations differ significantly. (I want to prove, that variables are correlated differently, depending on the group a person is in.)
Greetings from Freiburg im Breisgau (Germany),
Timo Stolz
2007 Apr 23
3
getElementsBySelector problem in IE
...ating a fieldset within a form (so you can upload
more than one photo). [BTW, the fieldsets have a CSS id which relates
to the object id of the existing photo (the form is also used for
editing, so you need this so the user can replace replace them), or a
pseuo id of the form "n_0", "n_1", ...]
This is how I''m doing it (and I''m sure there must be a more elegant
way, but as I said, just a js novice):
var mostRecentForm = $$(''fieldset.photo_fields'').last(); // get the
bottom fieldset
var formNumber = mostRecentForm.id.replace(''ph...
2004 Aug 31
2
sample size for t-tests
Dear all,
Could any one please tell me the exact formula R uses to calculate the sample size for one-sample and two-sample t-tests? Thanks,
Caimiao
[[alternative HTML version deleted]]
2024 Jan 23
0
Quantiles of sums of independent discrete random variables
Greetings,
I have the following?
Problem:
Given k (=10) discrete independent random variables X_i with n_i (= 5 to 20) values each,compute quantiles of the distribution of the sum X = X_1+...+X_k.
Here X has n=n_1 x n_2 ... n_k distinct values which is too large to list them all together with
their probabilities.
I tried several approaches:
(A) Convolution:
each X_j is approximated with Y_j=X_j+Z, where Z is
an N(0,sigma) variable with small sigma. Then Y_j is a probability mixture of the normal
variabl...
2006 Sep 01
1
integration problem with gamma function
...* Dii) / NN
Dsi <- (Ni-1) / Ni * si^2 + Di^2
Dsii <- (Nii-1) / Nii * sii^2 + Dii^2
DsD <- (Ni * Dsi + Nii * Dsii) / NN
ss <- sqrt(NN * (DsD - DD^2) / (NN-1))
### descriptive statistics
print(" \n------------- Data ---------------------------------------\n")
print(paste("N_1 = ",Ni ," : Mean_1 ? s_1 = ", Di," ? ",si, sep=""))
print(paste("N_2 = ",Nii," : Mean_2 ? s_2 = ", Dii," ? ",sii,
sep=""))
print(paste("N = ", NN ," : Mean_comb ? s_comb = ", DD," ?...