search for: n_j

Displaying 10 results from an estimated 10 matches for "n_j".

Did you mean: n_
2013 Aug 27
1
Error in simulation. NAN
...inpack.h> #include <R_ext/Lapack.h> #include <R_ext/BLAS.h> #include "funzioni.h" #define _USE_MATH_DEFINES extern "C" { SEXP Model1_imp11Cpp( SEXP ad_start_r, SEXP ad_end_r, SEXP ad_esp_r, SEXP burnin_r, SEXP thin_r,SEXP iter_1_r,SEXP iter_2_r, SEXP n_j_r,SEXP J_r, SEXP prior_alpha_r,SEXP prior_rho_r,SEXP prior_sigma2_r,SEXP prior_phi_r,SEXP prior_zeta2_r, SEXP sdprop_rho_r,SEXP sdprop_sigma2_r, SEXP start_alpha_r,SEXP start_mu_r,SEXP start_rho_r,SEXP start_sigma2_r,SEXP start_k_r,SEXP start_phi_r, SEXP start_zeta2_r, SEXP x_r,SEXP H...
2005 Nov 29
1
rlogis() in simulation
...and for the student effect to be 1.45 as I describe above? You can see my erroneous code below. Thanks, Harold ## Note, the subscripts are a little messy as I am changing some notation. But it should be transparent (I hope) N <- 5000 # Number of students J <- 50 # Number of schools N_j <- N/J # Number of students in each school rps <- rep(N_j, J) error <- matrix(numeric(N * 40), ncol = 40) for(i in 1:40){ e_gik <- rlogis(N, 0, sqrt(1.7-.25) ) e_gk <- rep(rlogis(J, 0, sqrt(.25) ), rps) error[,i] <- e_gk + e_gik } Windows XP platform i386-pc-mingw32 a...
2005 Dec 01
1
Simulate Correlated data from complex sample
...39;ve used RSiteSearch() a bit, but the keywords I'm using aren't turning up results that I can use. I may be missing something very simple and transparent. Any thoughts are much appreciated, Harold Ver 2.2 Windows XP N <- 5000 # Number of students J <- 50 # Number of schools N_j <- N/J # Number of students in each school a_g <- c(0,.5,1) # This is the growth vector # Step 1 -- create psi for base grade rps <- rep(N_j, J) v_gk <- rep(rnorm(J, 0, sqrt(.01) ), rps) v_gik <- rnorm(N, 0, sqrt(.99)) # Organize into a dataframe data <- data.frame(schid = re...
2008 Aug 15
2
Design-consistent variance estimate
...\left[\frac{\partial f(Y)}{Y}\right]^2 var(Y) \end{equation} \noindent where \begin{equation} \left[\frac{\partial f(Y)}{Y}\right] = \frac{1}{N} \end{equation} \begin{equation} var(Y) = \frac{k}{k-1} \sum_{j=1}^k(\hat{Y}_j-\hat{Y}_{..})^2 \end{equation} \begin{equation} \hat{Y}_j = \sum_{i=1}^{n_j}\hat{Y}_{j(i)} \end{equation} \begin{equation} \hat{Y}_{..} = k^{-1} \sum_{j=1}^k \hat{Y}_j \end{equation} \noindent where $j$ indexes cluster $(1, 2, \ldots, k)$, $j(i)$ indexes the $i$th member of cluster $j$, and $n_j$ is the total number of members in cluster $j$. The standard error is then t...
2000 May 03
0
Combinatorics for nonparametric tests
..._cbind(p,i) v_c(1:i,1:(i-1)) for(j in 2:i){v_v[-1] p_rbind(p,pp[,v[1:i]])}} p} Until now I hesitated to dwell on writing functions to generate all n!/(k!(n-k)!) k-combinations of an n-element set or more generally all n!/(k_1!k_2!...n_k!) choices of placing n objects into k boxes where box j has n_j objects. Not intending to re-invent the wheel I turn to the R community to ask if someone has already written these functions. Any help is thankfully appreciated. --- D.Trenkler --- ************************************************************************ ********* Dietrich Trenkler (trenk...
2011 Jan 03
1
Greetings. I have a question with mixed beta regression model in nlme.
*Dear R-help: My name is Rodrigo and I have a question with nlme package in R to fit a mixed beta regression model. The details of the model are: Suppose that:* *j in {1, ..., J}* *(level 1)* *i in {1, ..., n_j}* *(level 2)* *y_{ij} ~ Beta(mu_{ij} * phi_{ij}; (1 - mu_{ij}) * phi_{ij}) y_{ij} = mu_{ij} + w_{ij} * *with* *logit(mu_{ij}) = Beta_{0i} + Beta_{1i} * x1_{ij} + b2 * x2_{ij} log(phi_{ij}) = Gamma_{0i} + Gamma_{1i} * z1_{ij} + c2 * z2_{ij} * *Beta_{0i} = b_0 + u_{0i} Beta_{1i} = b_1 + u_{1i} Gam...
2011 Jan 03
0
Greetings. I have a question with mixed beta regression model in nlme (corrected version).
...nlme package in R to fit a mixed beta regression model. I'm so sorry. In the last email, I forgot to say that W is also a unknown parameter in the mixed beta regression model. In any case, here I send you the correct formulation. ** Suppose that:* *j in {1, ..., J}* *(level 1)* *i in {1, ..., n_j}* *(level 2)* *y_{ij} ~ Beta(mu_{ij} * phi_{ij}; (1 - mu_{ij}) * phi_{ij}) y_{ij} = mu_{ij} + w_{ij} * *with* *logit(mu_{ij}) = Beta_{0i} + Beta_{1i} * x1_{ij} + b_2 * x2_{ij} log(phi_{ij}) = Gamma_{0i} + Gamma_{1i} * z1_{ij} + c_2 * z2_{ij} * *Beta_{0i} = b_0 + u_{0i} Beta_{1i} = b_1 + u_{1i} G...
2003 Oct 05
2
Jonckheere-Terpstra test
Hello, can anybody here explain what a Jonckheere-Terpstra test is and whether it is implemented in R? I just know it's a non-parametric test, otherwise I've no clue about it ;-( . Are there alternatives to this test? thanks for help, Arne
2006 May 20
1
(PR#8877) predict.lm does not have a weights argument for newdata
Dear R developers, I am a little disappointed that my bug report only made it to the wishlist, with the argument: Well, it does not say it has. Only relevant to prediction intervals. predict.lm does calculate prediction intervals for linear models from weighted regression, so they should be correct, right? As far as I can see they are bound to be wrong in almost all cases, if no weights
2011 Aug 25
1
Syntax for a three-level logistic model
Dear People at R help, I am trying to figure out the syntax for a three-level logistic model with a single random effect (intercept): Data Collected My data consist of three levels: level 1 is four setting for each student (setting nested within student), and each student is registered in one of 14 universities (students nested within university). More detailed: A. 2,479 students who have a