search for: toby909

Displaying 19 results from an estimated 19 matches for "toby909".

2007 Aug 07
1
R2WinBUGS results not different with different runs
Hi All I dont know if anyone else has noticed the same thing, but with 2 subsequent runs of the same syntax, I am getting exactly the same results. I was expecting that results differ slighlty, say in the 4th or 5th decimal place. Is this a specialty with R2WinBUGS? Does it have something to do with the seed value? Isnt the seed value reset everytime I restart winbugs? Thanks Toby
2007 Mar 09
2
piecing together statements (macro?)
Hi All I am pretty new to R but saw stata and sas's macro facilities and am looking for how such things work in R. I am trying to piece together a series of statements: n = 5 #want to have it dynamic with respect to n for (j in 1:n) { eval(paste("x", j, "=x[", j, "]", sep="")) } I want the created statements 'x1=x[1]' immediately executed
2007 Jun 01
2
how to specify starting values in varIdent() of lme()
I was reading the help but just did not get how to specify starting values for varIdent() of the lme() function, although I managed to do it for corSymm(). Do I specify the values just as they are printed out in an output, like c(1, 1.3473, 1.0195). Or do I need to take the residual and multiply it with these like c(0.2235, 0.2235*1.3473, 0.2235*1.0195) or any other form that I dont know of?
2007 Jul 21
2
avoiding timconsuming for loop renaming identifiers
Hi All I was wondering if I can avoid a time-consuming for loop on my 600000 obs dataset. school_id y 8 9.87 8 8.89 8 7.89 8 8.88 20 6.78 20 9.99 20 8.79 31 10.1 31 11 There are, say, 143 different schools in this 600000 obs dataset. I need to thave sequential identifiers, 1,2,3,4,5,...,143. I was using an
2007 May 23
2
saving datafreame object problem
Do I miss here something? dtaa = read.table("http://www.ats.ucla.edu/stat/mplus/examples/ma_snijders/mlbook1.dat", sep=",") head(dtaa) # shows the data as it should be save(dtaa,"dtaa",file="c:/dtaa") d = load("c:/dtaa") head(d) # all data is lost, it only shows [1] "dtaa" "dtaa" Thanks for your hint on this.
2007 Oct 29
1
lm design matrix bug?
Hi All Maybe I dont understand it, but I would have expected that the design matrix has as many rows as there were observations available to fit the model. Below a small artificial dataset created, then one model fitted and the design matrix outputted, having 27 rows. Then I delete 6 obs, and fit the model on these 21 obs, but the design matrix that comes out has 26 rows? Thanks for your
2007 May 21
1
can I get same results using lme and gls?
Hi All I was wondering how to get the same results with gls and lme. In my lme, the design matrix for the random effects is (should be) a identity matrix and therefore G should add up with R to produce the R matrix that gls would report (V=ZGZ'+R). Added complexity is that I have 3 levels, so I have R, G and say H (V=WHW'+ZGZ'+R). The lme is giving me the correct results, I am
2007 Apr 02
1
controling omitted category in factor()
Hi All How can I specify which category R should omit when running a linear model with categorical predictors? I saw it omits the first category by default, but I like to have the 3rd category omitted. Thanks for your hints. Toby
2007 Jul 29
1
R2WinBUGS more updates after model did not converge
After running a model for a while and seeing that it did not converge yet, how can I continue to run, ie not starting anew, the model? I know if I manually/interactively use winbugs, this is possible anytime, but how can I do this in r2winbugs, so that my existing sim$sims.array and other stuff in the object that bugs() returns gets extended? Thanks Toby
2007 Jun 06
1
opening a file from within a zipfile that is online
Hi Reading the help for ?unz I was wondering if I can read data into R from within an zipfile that is on some website, like maybe: dtaa = read.table(unz("http://www.ats.ucla.edu/stat/examples/alsm/alsm.zip","Ch01pr19.dat")) Thanks for letting me know if you came acros such a thing before. Toby
2007 Jul 21
1
R2WinBUGS awkward to use
Hi All Does anyone know if I can avoid to use the write.model() function below? I dont want to do this. Can't bugs() do that automatically for me just by specifying the 4th argument 'model'? Just I like I am also using the 'inits' object! If I use 'model' in the same way as I use 'inits' I am getting the error: > sim <- bugs(data, inits, parameters,
2007 Jun 06
1
fixed effects anova in lme lmer
Can lme or lmer fit a plain regular fixed effects anova? Ie a model without a random effect, or have there be at least one random effect in order for these functions to work? Trying to run such, (1) without specifying a random effect produces an error, (2) specifying that there is no random effect does not produce the same output as an anova run in lm(); (2b) specifying that there is no
2007 Mar 10
3
long character string problem
Hi All I am having 2 very long character strings (550chars) and I want to put them as expressions together with c(). The problem is that I also get these double-quotes, as seen below in 'fct'. How can I remove these double-quotes? I tried as.name() but it did not work (because of size?). These are creating trouble with subsequent programs, which I tested with strings that for some
2008 Mar 16
1
stats/debugging question hotelling t-sq
Hi I spent hours looking over my formula. Somehow I cant find the reason why it gives me different answer. help appreciated. x = as.matrix(read.table("http://www.niehs.nih.gov/research/atniehs/core/microarrays/docs/heinloth.txt",1)) x = t(x) #now rows are subjects, cols are genes x = x[order(rownames(x)),] #order by treatment group oxygen, ultra-violet, gamma radiation y =
2008 Apr 06
1
lme cant get parameter estimated correctly
I am caught in a mental trap. Why isn't the between groups variance estimated (0.0038) to be around the value with which I generated the data (0.0002)? Thanks Toby set.seed(76589437887) fph = 0.4 Sigh = sqrt(0.0002) Sigi = sqrt(0.04) ci = 1 fpi = matrix(,7200,3) for (i in 1:90) { fph = rnorm(1, fph, Sigh) for (k in 1:80) { fpi[ci,1:3] = matrix(c(i, k, rnorm(1, fph, Sigi)),1) ci
2007 Oct 26
1
bugs() ignores my inits
Hi All I can specify whatever inits, it has no effect on the estimation. I am replicating a textbook example. The result is completely trash, having estimates of -58.7 (sd=59.3), where it should be closer to an ml estimate of 0.585 (SE=0.063). The two chains within one run are different, but with different inits for different runs, I get exactly the same chains, and I mean exactly. If I set
2007 Apr 04
0
to findout maximized log likelihoods by using rlarg.fit (for several r order statistics)
...unb.ca) > 9. Re: Referencing function name from within > function (jim holtman) > 10. Re: converting a list to a data.frame > (Dimitris Rizopoulos) > 11. help: protein class prediction in > bioinformatics (Bing Xiong) > 12. controling omitted category in factor() > (toby909 at gmail.com) > 13. approx with ties = 'ordered' (Vadim > Ogranovich) > 14. Re: Referencing function name from within > function > (Prof Brian Ripley) > 15. Re: converting a list to a data.frame (Stephen > Tucker) > 16. confine a dataframe with a polygo...
2007 May 18
0
gls() error
Hi All How can I fit a repeated measures analysis using gls? I want to start with a unstructured correlation structure, as if the the measures at the occations are not longitudinal (no AR) but plainly multivariate (corSymm). My data (ignore the prox_pup and gender, occ means occasion): > head(dta,12) teacher occ prox_self prox_pup gender 1 1 0 0.76 0.41 1 2
2007 Apr 06
0
translating sas proc mixed to lme()
Hi All I am trying to translate a proc mixed into a lme() syntax. It seems that I was able to do it for part of the model, but a few things are still different. It is a 2-level bivariate model (some call it a pseudo-3-level model). PROC MIXED DATA=psdata.bivar COVTEST METHOD = ml; CLASS cluster_ID individual_id variable_id ; MODEL y = Dp Dq / SOLUTION NOINT; RANDOM Dp Dq / SUBJECT = cluster_ID