Displaying 20 results from an estimated 100 matches similar to: "problem on simulation code (the loop unable to function effectively)"
2016 Apr 19
0
problem on simulation code (the loop unable to function effectively)
Hi Si Jie,
Again, please send questions to the list, not me.
Okay, I may have worked out what you are doing. The program runs and
produces what I would expect in the rightmost columns of the result
"g".
You are storing the number of each test for which the p value is less
than 0.05. It looks to me as though the objects storing the results
should be vectors as you are only storing 100 p
2016 Apr 18
0
R [coding : do not run for every row ]
You can make this much more readable with apply functions.
result <- apply(
all_combine1,
1,
function(x){
p.value <- sapply(
seq_len(nSims),
function(sim){
gamma1 <- rgamma(x["m"], x["sp(skewness1.5)"], x["scp1"])
gamma2 <- rgamma(x["n"], x["scp1"], 1)
gamma1 <- gamma1 -
2016 Apr 17
2
R [coding : do not run for every row ]
i have combined all the variables in a matrix, and i wish to conduct a simulation row by row.
But i found out the code only works for the every first row after a cycle of nine samples.
But after check out the code, i don know where is my mistake...
can anyone pls help ....
#For gamma disribution with equal skewness 1.5
#to evaluate the same R function on many different sets of data
2016 Apr 18
3
R [coding : do not run for every row ]
Hi, i am sorry, the output should be values between 0 and 0.1 and not supposed to be 1.00, it is because they are type 1 error rate. And now i get output 1.00 for several samples,rhis is no correct. The loop do not run for every row. i do not know where is my mistake. As i use the same concept on normal distribution setup, i get the result.
Sent from my phone
On Thierry Onkelinx
2016 Apr 18
0
R [coding : do not run for every row ]
Always keep the mailing list in cc.
The code runs for each row in the data. However I get the feeling that
there is a mismatch between what you think that is in the data and the
actual data.
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature
and Forest
team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance
Kliniekstraat 25
1070
2016 Apr 18
0
R [coding : do not run for every row ]
Dear anonymous,
The big mistake in the output might be obvious to you but not to
others. Please make clear what the correct output should be or at
least what is wrong with the current output.
And please DO read the posting guide which asks you not to post in HTML.
ir. Thierry Onkelinx
Instituut voor natuur- en bosonderzoek / Research Institute for Nature
and Forest
team Biometrie &
2009 Jun 05
2
p-values from VGAM function vglm
Anyone know how to get p-values for the t-values from the coefficients
produced in vglm?
Attached is the code and output ? see comment added to output to show
where I need p-values
+ print(paste("********** Using VGAM function gamma2 **********"))
+ modl2<-
vglm(MidPoint~Count,gamma2,data=modl.subset,trace=TRUE,crit="c")
+ print(coef(modl2,matrix=TRUE))
2009 Jun 16
0
Generation from COX PH with gamma frailty
Hello,
I want to generate data set from Cox PH model with gamma frailty effects.
theta(parameter for frailty distribution)=2
beta=1.5
n=300
cluster size=30
number of clusters=10
I think I should first generate u from Gamma(Theta,theta) and then using
this theta I could not decide how I should generate the survival times?
Is there any package for this? or any document you could suggest?
Any
2009 Jun 26
1
predicted values after fitting gamma2 function
Question: after fitting a gamma function to some data, how do I get
predicted values? I'm a SAS programmer, I new R, and am having
problems getting my brain to function with the concept of "object as
class ...". The following is specifics of what I am doing:
I'm trying to determine the pdf from data I have created in a
simulation.
I have generated frequency counts
2011 Jun 07
0
WinBUGS on survival, simple but confusing question
Hi All,
I'm using WinBUGS on a very simple survival model (log-normal with one
covariate "Treat"), but I cannot understand the way it handles censored
data. I'm posting the R file which generates the data from pre-specified
parameters, as well as the .bug file.
The question is, if I use NA to denote the censored data (as suggested by
the example Mice in WinBUGS Example Vol.I),
2009 Aug 30
2
Sampling encoder timings between libtheora-1.0 & libtheora-1.1beta3
As requested by Ralph in my introduction e-mail to this list [1], I've
gone ahead and done some sample test timings for encoding between
libtheora-1.0 and libtheora-1.1beta3, as available from the Theora
website [2].
So far, I've tested with 4 different files that I generated with content
I already have. The files, in brief, are the following:
1. planet-earth-360x240.yuv4mpeg - A
2004 Jun 12
2
ordered probit or logit / recursive regression
> I make a study in health econometrics and have a categorical
> dependent variable (take value 1-5). I would like to fit an ordered
> probit or ordered logit but i didn't find a command or package who
> make that. Does anyone know if it's exists ?
R is very fancy. You won't get mundane things like ordered probit off
the shelf. (I will be very happy if someone will show
2009 Apr 11
2
who happenly read these two paper Mohsen Pourahmadi (biometrika1999, 2000)
http://biomet.oxfordjournals.org/cgi/reprint/86/3/677 biometrika1999
http://biomet.oxfordjournals.org/cgi/reprint/94/4/1006 biometrika2000
Hi All:
I just want to try some luck.
I am currenly working on my project,one part of my project is to
reanalysis the kenward cattle data by using the method in Mohsen's paper,but
I found I really can get the same or close output as he did,so,any
2007 May 08
0
Question on bivariate GEE fit
Hi,
I have a bivariate longitudinal dataset. As an example say,
i have the data frame with column names
var1 var2 Unit time trt
(trt represents the treatment)
Now suppose I want to fit a joint model of the form for the *i* th unit
var1jk = alpha1 + beta1*timejk + gamma1* trtjk + delta1* timejk:trtjk +
error1jk
var2 = alpha2 + beta2*timejk + gamma2* trtjk + delta2* timejk:trtjk +
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
2002 Apr 22
3
glm() function not finding the maximum
Hello,
I have found a problem with using the glm function with a gamma
family.
I have a vector of data, assumed to be generated by a gamma distribution.
The parameters of this gamma distribution are estimated in two ways (i)
using the glm() function, (ii) "by hand", using the optim() function.
I find that the -2*likelihood at the maximum found by (i) is substantially
larger than that
2016 Apr 25
0
use switch or function in connecting different cases.
This is my current work.Now i am trying to use a function to do the normal distribution simulation.
rm(list=ls())
t <- u<- mann<- rep(0, 45)
Nsimulation<-function(S1,S2,Sds,nSims)
{
set.seed(1)
for (sim in 1:nSims)
{
matrix_t <-matrix(0,nrow=nSims,ncol=3)
matrix_u<-matrix(0,nrow=nSims,ncol=3)
2007 Feb 17
1
Solve in maximum likelihood estimation
Hi,
I got the following problem.
I am doing a maximum likelihood estimation for a Kalman Filter.
For this purpose, I have to invert an error matrix Ffast of dimension
"no. parameters X no.parameters". The usualy optim methods often find only
local minima, so I decided to make the optimization using the SANN
algorithm, which is very slow already.
However, this becomes a real problem
2016 Apr 25
2
R: use switch or function in connecting different cases.
HI, I am trying to use switch () function to connect the three distribution (normal ,gamma with equal skewness and gamma with unequal skewness.
But i am losing my ideas since i have
sample sizes-(10,10),(10,25),(25,25),(25,50),(25,100),50,25),(50,100), (100,25),(100,100)
standard deviation ratio- (1.00, 1.50, 2.00, 2.50, 3.00 and 3.50)
distribution of gamma distribution with unequal skewness
2006 Oct 27
0
VGAM package released on CRAN
Dear useRs,
upon request, the VGAM package (currently version 0.7-1) has been
officially released on CRAN (the package has been at my website
http://www.stat.auckland.ac.nz/~yee/VGAM for a number of years now).
VGAM implements a general framework for several classes of
regression models using iteratively reweighted least squares
(IRLS). The key ideas are Fisher scoring, generalized linear
and