similar to: about loop, 10 times, 10 matrix

Displaying 20 results from an estimated 10000 matches similar to: "about loop, 10 times, 10 matrix"

2010 Oct 04
2
i have aproblem --thank you
dear professor: thank you for your help,witn your help i develop the nomogram successfully. after that i want to do the internal validation to the model.i ues the bootpred to do it,and then i encounter problem again,just like that.(´íÎóÓÚerror to :complete.cases(x, y, wt) : ²»ÊÇËùÓеIJÎÊý¶¼Ò»Ñù³¤(the length of the augment was different)) i hope you tell me where is the mistake,and maybe i have
2007 Sep 10
1
Generating Replicate Datasets (using loops or other means)
Hello All, I have searched many help forums, message boards, etc. and I just can't apply the comments to what I need my program to do. I am running R 2.5.1 on an XP system, and my desire is to produce replicate datasets for a simulation study I am running. Essentially, I have sets of parameters (a's, b's, and c's) that define a function which produces a decimal value. This
2009 Nov 29
1
optim or nlminb for minimization, which to believe?
I have constructed the function mml2 (below) based on the likelihood function described in the minimal latex I have pasted below for anyone who wants to look at it. This function finds parameter estimates for a basic Rasch (IRT) model. Using the function without the gradient, using either nlminb or optim returns the correct parameter estimates and, in the case of optim, the correct standard
2011 May 04
1
hurdle, simulated power
Hi all-- We are planning an intervention study for adolescent alcohol use, and I am planning to use simulations based on a hurdle model (using the hurdle() function in package pscl) for sample size estimation. The simulation code and power code are below -- note that at the moment the "power" code is just returning the coefficients, as something isn't working quite right. The
2012 Dec 04
1
Solve system of equations (nleqslv) only returns origin
I'm solving 4 complex equations simultaneously. Code is below. The code returns only zero's for the solution though there should also be a non-zero result. I'm pretty confident that the equations are correct because they are straight from a published paper and I checked them pretty thoroughly. The parameter values I used are from the published paper as well. Any suggestions for how
2008 Mar 19
1
problem with optim and integrate
Dear all, I want to min "integrate( (p1*dnorm+p2*dnorm+p3*dnorm)^(1.3))" for p, mu, and sigma. So, I have to estimate 8 parameters(p3=1-p1-p2). I got this warning-"Error in integrate(numint, lower = -Inf, upper = Inf) : non-finite function value." My questions are How could I fix it? I tried to divide into several intervals and sum up, but I got same message. My code is
2009 Mar 01
1
Combining 2 arrays into a third array via a function
I'm completely stumped and seem to be going around for 2 days in the wrong circles. Here's what I have in 2 dataframes: > dim(params.data); head(params.data, n=2) [1] 284 6 item a1 a2 b1 b2 c 1 1 0.6671587 0.9588642 -3.5 -3.437961 0.2 2 2 1.1296298 1.4899307 -3.5 -4.146118 0.2 > dim(examinees.data); head(examinees.data, n=2) [1] 1600 3 examinee
2006 Aug 24
1
Optim question
This is a very basic question, but I am a bit confused with optim. I want to get the MLEs using optim which could replace the newton-raphson code I have below which also gives the MLEs. The function takes as input a vector x denoting whether a respondent answered an item correctly (x=1) or not (x=0). It also takes as input a vector b_vector, and these are parameters of test items (Rasch estimates
2005 Mar 03
2
regression on a matrix
Hi - I am doing a monte carlo experiment that requires to do a linear regression of a matrix of vectors of dependent variables on a fixed set of covariates (one regression per vector). I am wondering if anyone has any idea of how to speed up the computations in R. The code follows: #regression function #Linear regression code qreg <- function(y,x) { X=cbind(1,x) m<-lm.fit(y=y,x=X)
2000 Dec 01
1
bug in outer() (PR#755)
Full_Name: Matthias von Davier Version: 1.1.1 OS: nt4.0 Submission from: (NULL) (144.81.31.148) sim3pl <- function(theta,i) { p2 <- p3pl(theta,i) p1 <- runif(1) temp <- response(p1,p2) return(p1) } when calling outer(theta,items,sim3pl), where theta = rnorm(100,m,s) and items = seq(1:nvar) runif(1) is only called once (instead of 100*nvar times), even though if calling sim3pl
2010 Feb 03
1
legend help
i=1 for(rate in c(2,4) ){ for(shape in c(1,3,5) ){ curve(dgamma(x,rate,shape),xlim=c(0,3),ylab="",col=i,lty=i,add=T) i=i+1 } } How can I add some legend to represent these lines? i.e. the legend is displayed as col=1 lty=1 lambda=2 theta=1 col=2 lty=2 lambda=2 theta=3 col=3 lty=3 lambda=2 theta=5 col=4 lty=4 lambda=4 theta=1 col=5 lty=5 lambda=4 theta=3 col=6 lty=6 lambda=4 theta=5
2023 Dec 02
1
Try reproduce glmm by hand
Dear all, In order to be sure I understand glmm correctly, I try to reproduce by hand a simple result. Here is a reproducible code. The questions are in _________________ Of course I have tried to find the solution using internet but I was not able to find a solution. I have also tried to follow glmer but it is very complicated code! Thanks for any help. Marc # Generate set of df with nb
2011 Jan 25
1
deSolve: Problem solving ODE including modulo-operator
I have a problem integrating the 'standard map' ( http://en.wikipedia.org/wiki/Standard_map http://en.wikipedia.org/wiki/Standard_map ) with deSolve: By using the modulo-operator '%%' with 2*pi in the ODEs (standardmap1), the resulting values of P and Theta, should not be greater than 2pi. Because this was not the case, i was thinking that the function 'ode' has some
2012 Apr 14
1
R Error/Warning Messages with library(MASS) using glm.
Hi there, I have been having trouble running negative binomial regression (glm.nb) using library MASS in R v2.15.0 on Mac OSX. I am running multiple models on the variables influencing the group size of damselfish in coral reefs (count data). For total group size and two of my species, glm.nb is working great to deal with overdispersion in my count data. For two of my species, I am getting a
2011 Feb 15
1
gList and gTree methods of grid::grobX
Dear all, In an attempt to draw fill patterns in grid graphics, I have encountered a behavior of grobX that I cannot understand from the documentation. Consider this, library(grid) ## gTree g1 <- gTree(children=gList( rectGrob(0.5,0.5, width=unit(0.8,"npc"), height=unit(2,"cm")), circleGrob(r=0.3)), vp=viewport(0.5,0.5)) ##
2012 May 03
1
overlapping confidence bands for predicted probabilities from a logistic model
Dear list, I'm a bit perplexed why the 95% confidence bands for the predicted probabilities for units where x=0 and x=1 overlap in the following instance. I've simulated binary data to which I've then fitted a simple logistic regression model, with one covariate, and the coefficient on x is statistically significant at the 0.05 level. I've then used two different methods to
2009 Feb 04
2
overlay plot question
Greetings all, I have two logistic plots coming from two calls to plogis. The code is .x <- seq(-7.6, 7.6, length=100) plot(.x, plogis(.x, location=0, scale=1), xlab="x", ylab="Density", main="Logistic Distribution: location = 0, scale = 1", type="l") abline(h=0, col="gray") .y <- seq(-7.6, 7.6, length=100) plot(.x, plogis(.x,
2009 Jan 10
2
Print specific matrix value???
Hello All, I'm trying to print specific row and column for Observed_Scores matrix, however, when I execute the command "Observed_Scores[1,1]", I get the message "Error in Observed_Scores[1, 1] : incorrect number of dimensions". Could you please help and let me know where is the mistake? Here is my program: library(ltm) library(psych) # Settting the working directory
2008 Aug 14
3
extending the derivs table/fools rushing in
I added "plogis" to the derivative table in the development version of R; the patch against yesterday's R-devel src/deriv/main.c is available at http://www.zoology.ufl.edu/bolker/deriv_patch.txt . I pretty much followed the framework of the other symbols; here was my incantation - } else if (CAR(expr) == PlogisSymbol) { - ans = simplify(TimesSymbol, -
2005 Aug 22
1
How to add legend of plot.Design function (method=image)? (if (!.R.) )
Hi, When running z <- plot(fit, age=NA, cholesterol=NA, perim=boundaries, method='image') Legend(z, fun=plogis, at=qlogis(c(.01,.05,.1,.2,.3,.4,.5)), zlab='Probability') And after pointing the cursor to the plot() screen in R, I obtain the following message: Using function "locator(2)" to place opposite corners of image.legend Error in