search for: p_i

Displaying 20 results from an estimated 27 matches for "p_i".

Did you mean: _i
2007 Mar 05
3
Mixed effects multinomial regression and meta-analysis
R Experts: I am conducting a meta-analysis where the effect measures to be pooled are simple proportions. For example, consider this data from Fleiss/Levin/Paik's Statistical methods for rates and proportions (2003, p189) on smokers: Study N Event P(Event) 1 86 83 0.965 2 93 90 0.968 3 136 129 0.949 4 82 70 0.854 Total
2010 Mar 25
1
how to deal with vector[0]?
Hi, I have a vector with 4 elements, e.g., tau_i=c(100,200,300,400), but potentially tau_i[0]=0. In a "for" loop, tau_i=c(100,200,300,400) m=4 tau_i[0]=0 # <------- ? P_i=1 for(i in 2:m) { P_i = P_i*(tau_i[i-1]-tau_i[i-2]) } Error in P_i = P_i * (tau_i[k - 1] - tau_i[k - 2]): replacement has length zero Unfortunately, I can add this potential element into "tau_i" because it has been defined initially and used mainly throughout all procedures....
2001 Feb 15
2
deviance vs entropy
Hello, The question looks like simple. It's probably even stupid. But I spent several hours searching Internet, downloaded tons of papers, where deviance is mentioned and... And haven't found an answer. Well, it is clear for me the using of entropy when I split some node of a classification tree. The sense is clear, because entropy is an old good measure of how uniform is distribution.
2010 Dec 15
4
Generacion de binomiales correlacionadas
...bucion binomial bivariada en la que hay _cierto_ grado de correlacion (denotemoslo rho). Podria por favor alguien indicarme como hacerlo en R? Este es el contexto. Supongamos que se tienen dos experimentos en los que la variable respuesta _sigue_ una distribucion binomial, i.e., X_i ~Binomial(n_i, p_i), i=1,2 y que, por ahora, n_i y p_i son conocidos. El interes principal es calcular T = P(X_1=1, X_2=1). Si las X_i''s fueran independientes (caso 1), seria suficiente generar binomiales con los parametros correspondientes a cada tipo de experimento (via rbinom) y calcular lo que se necesi...
2003 Oct 31
1
constrained nonlinear optimisation in R?
Hello. I have searched the archives but have not found anything. I need to solve a constrained optimisation problem for a nonlinear function (“maximum entropy formalism”). Specifically, Optimise: -1*SUM(p_ilog(p_i)) for a vector p_i of probabilities, conditional on a series of constraints of the form: SUM(T_i*p_i)=k_i for given values of T_i and k_i (these are constraints on expectations). Can this be done in R? Bill Shipley Associate Editor, Ecology North American Editor, Annals of Bo...
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...
2009 Oct 28
2
regression on large file
...uot;) d<-as.numeric(line[-1]) name<-line[1] modela <- lm(s1~a+a2+b+s+M+W) modelb <- lm(s2~a+a2+b+s+M+W+d) modelc <- lm(s3~a+2+b+s+M+W+d+d*s) p_main <- anova(modela,modelb)$P[2] p_main_i <- anova(modela,modelc)$P[2] p_i <- anova(modelb,modelc)$P[2] cat(c(name,p_main,p_main_i,p_i),file=paste("out",".txt",sep=""),append=T) cat("\n",file=paste("out",".txt",sep=""),append=T) } [[alternative HTML version deleted]]
2006 Dec 28
0
lmer: Interpreting random effects contrasts and model formulation
...t the output and my model formulations. I have replicate measures on Lines which are strictly nested within Populations. (a) So if I want to fit a model where Line is a random effect and Populations are fixed and the random Line effect is constant across Populations, I have: measure_ijk = mu + P_i + L_ij + e_ijk where L ~ N(0,s_L) measure ~ 1 + Population + (1|Population:Line) (b) If instead I want to allow the random Line effect to be Population specific, I put: measure_ijk = mu + P_i + L_ij + e_ijk where L_i ~ N(0,s_L_i) measure ~ 1 + Population + (Population | Population:Line) (c) Ques...
2009 Apr 08
0
Comparing Proportions Among Groups
Hi everyone, I am trying to compare proportions among groups using the logistic regression approach as follows: 1) Fit the model log(p_i/(1-p_i)) = M + G_i, where p_i is the probability of success in group i and G_i is the effect of group i, i=1,..,I. 2) Test the hypotheses: Ho: G_1 = G_2 = ... = G_I (the probability of success is the same for all groups) versus Ha: at least two G_i's are different (at least two grou...
2004 Feb 03
1
Stereo mode settings
Hi everyone, I'd like a bit of information about the stereo mode settings in psych_44.h of libvorbis. Specifically, about the adj_stereo structure: typedef struct { int pre[PACKETBLOBS]; int post[PACKETBLOBS]; float kHz[PACKETBLOBS]; float lowpasskHz[PACKETBLOBS]; } adj_stereo; What I am attempting to do is bring lossless stereo coupling down to the lower quality levels in
2009 Nov 04
1
compute maximum likelihood estimator for a multinomial function
Hi there I am trying to learn how to compute mle in R for a multinomial negative log likelihood function. I am using for this the book by B. Bolker "Ecological models and data in R", chapter 6: "Likelihood an all that". But he has no example for multinomial functions. What I did is the following: I first defined a function for the negative log likelihood:
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 Jul 07
1
CDF plot
Dear all, I have define a discrete distribution P(y_i=x_i)=p_i, which I want to plot a CDF plot. However, I can not find a function in R to draw it for me after searching R and R-archive. I only find the one for the sample CDF instead my theoretical one. I find stepfun can do it for me, however, I want to plot some different CDF with same support x in one plo...
2007 Mar 09
1
help with zicounts
...p_{i})=x_{i}*beta with beta=1, and the Poisson part is log(?_{i})=x_{i}*gamma with gamma=1. beta.true<-1.0 gamma.true<-1.0 n<-1000 x<-matrix(rnorm(n),n,1) pi<-expit(x*beta.true) mu<-exp(x*gamma.true) y<-numeric(n) # blank vector z<-(runif(n)<pi) # logical: T with prob p_i, F otherwise y[z]<-rpois(sum(z),mu[z]) # draw y_i ~ Poisson(mu_i) where z_i = T y[!z]<-0 # set y_i = 0 where z_i = F Thanks for your time! Jacob Jacob L van Wyk Department of Statistics University of Johannesburg, APK P O Box 524 Auckland Park 2006 South Africa Tel: +27 11 489 3080 Fax: +...
2011 Jan 13
1
Weighted Optimization
Hi All, I am trying to code an R script which gives me the time varying parameters of the NIG and GH distributions. Further, becasue I think these these time varying parameters should be more responsive to more recent observations, I would like to include a weighted likelihood estimation proceedure where the observations have an exponentially decaying weighting rather than the equal weighting
2002 Jun 13
0
possum sleeping: thanks and fisher.test() FEXACT error
...ertain possum slept in on 12 nights. As Professor Ripley points out, a Monte-Carlo simulation is easy to set up, and it shows that chi-squared is inapplicable. If H0 is that the animal chooses randomly from amongst these 50 trees then the number of sleeps in each tree is multinomial with n=50 and p_i=12/50 for i=1:50 (H0 is biologically reasonable: the 50 trees were those in which a possum slept on at least one occasion). The next step is to check whether the five animals have different preferences. I have an array called alldata which has 50 rows (one per tree) and five columns (one per anim...
2008 Dec 23
6
Interval censored Data in survreg() with zero values!
Hello, I have interval censored data, censored between (0, 100). I used the tobit function in the AER package which in turn backs on survreg. Actually I'm struggling with the distribution. Data is asymmetrically distributed, so first choice would be a Weibull distribution. Unfortunately the Weibull doesn't allow for zero values in time data, as it requires x > 0. So I tried the
2003 Oct 21
2
Denominator Degrees of Freedom in lme() -- Adjusting and Understanding Them
...to be N*T-N-1, where N is total sample size and T is the number of timepoints (at least when data are balanced). In the Pinheiro and Bates book (p. 91), the degrees of freedom are given as m_i-(m_1-1+pi), where m_i is the number of groups at the ith level, m_0=1 if an intercept is included and p_i is the sum of the degrees of freedom corresponding to the terms estimated. I'm not sure how the N*T-N-1 matches up with the formula given on page 91. It seems to me the number of "groups" (i.e., m_i) would be equal to N, the number of individuals (note that this is what is given a...
2002 Jul 12
2
Crosstabs in R
Before I reinvent the wheel, I have need for a relatively straightforward crosstabulation (2 x n) function. I know that R has table(), ftable(), xtabs(), and summary(xtabs()), but none of these produce a fully "tricked" out cross-tabulation with marginal totals, expected cell frequencies, and an array of statistics about the contingency table. Is there a more complete (something
2010 Apr 23
3
Practical work with logistic regression
Dear all, I have a couple of short noob questions for whoever can take them. I'm from a very non-stats background so sorry for offending anybody with stupid questions ! :-) I have been using logistic regression care of glm to analyse a binary dependent variable against a couple of independent variables. All has gone well so far. In my work I have to compare the accuracy of analysis to a C4.5