Re: [R] Model Comparision for case control studies in R

2022-06-16 Thread Hana Tezera
> However the problem is solved, I would start by trying to determine if >> any >> > one model was appropriate. Are the model assumptions satisfied? If the >> > answer is no, then try another model until you find one that does >> > satisfy >> > the mo

Re: [R] Model Comparision for case control studies in R

2022-06-15 Thread anteneh asmare
Dear Tim, Thanks. the first vector y<-c(0,1,1,0,0,1,0,0,1,1,1,0,1,1,1,0,0,0,0,1) is the disease status y= (1=Case,0=Control). The covariate age, smoking status and hypertension are independent(uncorrelated). The logistic regression (unconditional) will used. But I need to compare other models with

Re: [R] Model To Simulate Dice Roll

2022-04-22 Thread David Carlson via R-help
Sorry, The last three lines should read: all <- apply(results, 1, function(x) length(intersect(x, seq(sides)))==sides) sum(all)/reps results <- as.data.frame(results) To generalize them for values of sides other than 6. On Fri, Apr 22, 2022 at 11:05 PM Paul Bernal wrote: > Thank you so much Da

Re: [R] Model To Simulate Dice Roll

2022-04-22 Thread Paul Bernal
Thank you so much David! El El vie, 22 de abr. de 2022 a la(s) 11:04 p. m., David Carlson < dcarl...@tamu.edu> escribió: > Since the rolls are independent, it is not necessary to separate the rolls > into two stages: > > sides <- 6 > months <- 12 > reps <- 100 > > set.seed(2022) > results <- matr

Re: [R] Model To Simulate Dice Roll

2022-04-20 Thread Paul Bernal
Dear Bert, Thank you for your kind reply. That is fine, I appreciate your feedback anyway. Have a great day/night. Best, Paul El mié, 20 abr 2022 a las 23:31, Bert Gunter () escribió: > I believe I gave you sufficient information (the vector of dice roll > results would replace 1:36 in my exa

Re: [R] Model To Simulate Dice Roll

2022-04-20 Thread Bert Gunter
I believe I gave you sufficient information (the vector of dice roll results would replace 1:36 in my example). Furthermore, this sounds like homework, which we try not to do here. But even if it is not, I expect you to fill in the details based on what I have provided. If I have misunderstood your

Re: [R] Model To Simulate Dice Roll

2022-04-20 Thread Bert Gunter
If I understand you correctly, it's simple. Matrices in R are vectors with a dimension attribute. By default, they are populated column by column. Use 'byrow = TRUE to populate by row instead. For example: > matrix (1:36, ncol = 12, byrow = TRUE) [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [

Re: [R] Model within subjects treatment variable and multiple measurements per treatment: is this the correct model?

2017-10-13 Thread Bert Gunter
Post on r-sig-mixed-models, not here. In PLAIN TEXT NOT HTML. -- Bert On Oct 13, 2017 10:55 AM, "Nynke l" wrote: > Hello all, > > > I have a question regarding my analysis and how to correctly model this in > r syntax. > > I have a dataset from an experiment in which each subject received 3 >

Re: [R] Model studies in one analysis using treatment as a five level moderator in a meta-regression

2017-06-28 Thread Michael Dewey
Dear Jay I am not that familiar with the meta package but it looks as though it does not allow you to do a meta-regression within metaprop. However there is a function metareg which takes the object you created with metaprop and allows you to add a moderator so i would try that next. By moder

Re: [R] Model studies in one analysis using treatment as a five level moderator in a meta-regression

2017-06-26 Thread PIKAL Petr
Petr > -Original Message- > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Jay Zola > Sent: Monday, June 26, 2017 11:44 PM > To: Vito Michele Rosario Muggeo > Cc: r-help@r-project.org > Subject: Re: [R] Model studies in one analysis using treatme

Re: [R] Model studies in one analysis using treatment as a five level moderator in a meta-regression

2017-06-26 Thread Jay Zola
Dear Vito, Thank you for your reply. I tried to contact the statistics departement numerous times, but did not receive any reply. That is why I started to look on the internet for help. Yours sincerely, Jay Verstuurd vanaf mijn iPhone > Op 26 jun. 2017 om 22:05 heeft Vito Michele Rosario Mug

Re: [R] Model studies in one analysis using treatment as a five level moderator in a meta-regression

2017-06-26 Thread Vito Michele Rosario Muggeo
hi Jay, Consult a local statistician. Statistics is not you think is (namely simple computations, R and probably plotting..). regards, vito Jay Zola ha scritto: Hello, I am medical student, writing a meta-analysis on complication and reoperation rates after the five most common treat

Re: [R] model specification using lme

2016-05-30 Thread Thierry Onkelinx
Dear Hanna, None of the models are correct is you want the same random intercept for the different methods but different random slope per method. You can random = ~ 1 + time:method | individual The easiest way to get alpha_0 and tau_i is to apply post-hoc contrasts. That is fairly easy to do wit

Re: [R] model specification using lme

2016-05-29 Thread Ben Bolker
li li gmail.com> writes: > > Hi all, > For the following data, I consider the following random intercept and > random slope model. Denote as y_ijk the response value from *j*th > individual within *i*th method at time point *k*. Assume the following > model for y_ijk: > > y_ijk= (alpha_

Re: [R] model non-integer count outcomes

2015-07-22 Thread Wensui Liu
Thanks Thierry What if I don't know the n in the offset term? On Wednesday, July 22, 2015, Thierry Onkelinx wrote: > If you know the number of counts (n) used to calculate the average then you > can still use a poisson distribution. > > Total = average * n > glm(total ~ offset(n), family = poiss

Re: [R] model non-integer count outcomes

2015-07-22 Thread peter dalgaard
> On 22 Jul 2015, at 06:48 , Don McKenzie wrote: > > Sorry. Central limit theorem. Or some sort of vegetarian sandwich. Celery, Lettuce, Tomato sounds almost edible with sufficient mayo. ;-) > Enough averaging and you get a normal distribution (simply stated, perhaps > too simply). If so oth

Re: [R] model non-integer count outcomes

2015-07-22 Thread Thierry Onkelinx
If you know the number of counts (n) used to calculate the average then you can still use a poisson distribution. Total = average * n glm(total ~ offset(n), family = poisson) ​ ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie &

Re: [R] model non-integer count outcomes

2015-07-21 Thread Don McKenzie
Sorry. Central limit theorem. Enough averaging and you get a normal distribution (simply stated, perhaps too simply). If so others will correct me before long. :-( Sent from my iPad > On Jul 21, 2015, at 8:52 PM, Wensui Liu wrote: > > what does CLT stand for? > >> On Tue, Jul 21, 2015 at 11

Re: [R] model non-integer count outcomes

2015-07-21 Thread Don McKenzie
Or if there are enough averages of enough counts, the CLT provides another option. > On Jul 21, 2015, at 8:38 PM, David Winsemius wrote: > > > On Jul 21, 2015, at 8:21 PM, Wensui Liu wrote: > >> Dear Lister >> When the count outcomes are integers, we could use either Poisson or >> NB regressi

Re: [R] model non-integer count outcomes

2015-07-21 Thread David Winsemius
On Jul 21, 2015, at 8:21 PM, Wensui Liu wrote: > Dear Lister > When the count outcomes are integers, we could use either Poisson or > NB regression to model them. However, there are cases that the count > outcomes are non-integers, e.g. average counts. > I am wondering if it still makes sense to

Re: [R] model selection

2015-06-16 Thread Bert Gunter
Wrong list! This is about R. Post on a statistics list like stats.stackexchange.com for statistics questions. Cheers, Bert Bert Gunter "Data is not information. Information is not knowledge. And knowledge is certainly not wisdom." -- Clifford Stoll On Mon, Jun 15, 2015 at 3:55 PM, bruno cid

Re: [R] Model for lm keeps producing an error

2014-07-18 Thread PIKAL Petr
Hi No reproducible example so lust general comments. 1. Your function does not return any value 2. You do not get errors but only warnings 3. In your function you get results only for X1. Is it really your intention? 4. I do not know mclapply but from quick look into help page parameters you use

Re: [R] model selection for nested factorial design

2014-05-14 Thread Ben Bolker
K C gmail.com> writes: > [snip] > I have a dataset composed of observations taken from 16 separate > experimental panels, each nested into one of 4 conditions (Treatment A > Level 1, Treatment A Level 2, Treatment B Level 1, Treatment > B Level 2; see > photo: http://imgur.com/ZbzFPNq). The

Re: [R] Model averaging using QAICc

2014-01-16 Thread Kamil Bartoń
On 2014-01-15 11:00, r-help-requ...@r-project.org wrote: Date: Wed, 15 Jan 2014 16:39:17 +1000 From: Diana Virkki To:r-help@r-project.org Subject: [R] Model averaging using QAICc Message-ID: Content-Type: text/plain Hi all, I am having some trouble running GLMM's and using model averagin

Re: [R] Model averaging using QAICc

2014-01-15 Thread Ben Bolker
Diana Virkki griffith.edu.au> writes: > > Hi all, > > I am having some trouble running GLMM's and using model averaging with > QAICc. > > Let me know if you need more detail here: > I am trying to run GLMM's on count data in the package glmmADMB with a > negative binomial distribution due to o

Re: [R] model selection with step()

2013-12-06 Thread Adams, Jean
Karen, Look at the help for the drop1() function. ?drop1 There you will see, "The hierarchy is respected when considering terms to be added or dropped: all main effects contained in a second-order interaction must remain, and so on." So, for fit2, the step() function will only consider dropp

Re: [R] model syntax processed --- probably common

2013-08-19 Thread William Dunlap
nday, August 19, 2013 1:05 PM > To: David Winsemius; r-help > Subject: Re: [R] model syntax processed --- probably common > > thank you. but uggh...sorry for my html post. and sorry again for > having been obscure in my attempt to be brief. here is a working > program. > &g

Re: [R] model syntax processed --- probably common

2013-08-19 Thread R. Michael Weylandt
On Aug 19, 2013, at 16:05, ivo welch wrote: > thank you. but uggh...sorry for my html post. and sorry again for > having been obscure in my attempt to be brief. here is a working > program. > > fama.macbeth <- function( formula, din ) { I think most users would expect 'din' to be 'data' he

Re: [R] model syntax processed --- probably common

2013-08-19 Thread ivo welch
thank you. but uggh...sorry for my html post. and sorry again for having been obscure in my attempt to be brief. here is a working program. fama.macbeth <- function( formula, din ) { fnames <- terms( formula ) dnames <- names( din ) stopifnot( all(dimnames(attr(fnames, "factors"))[[1]] %i

Re: [R] model syntax processed --- probably common

2013-08-19 Thread David Winsemius
On Aug 19, 2013, at 12:48 PM, David Winsemius wrote: > > On Aug 19, 2013, at 9:45 AM, ivo welch wrote: > >> dear R experts---I was programming a fama-macbeth panel regression (a >> fama-macbeth regression is essentially T cross-sectional regressions, with >> statistics then obtained from the ti

Re: [R] model syntax processed --- probably common

2013-08-19 Thread David Winsemius
On Aug 19, 2013, at 9:45 AM, ivo welch wrote: > dear R experts---I was programming a fama-macbeth panel regression (a > fama-macbeth regression is essentially T cross-sectional regressions, with > statistics then obtained from the time-series of coefficients), partly > because I wanted faster spe

Re: [R] model syntax processed --- probably common

2013-08-19 Thread Bert Gunter
Ivo: I may not get your question, but you seem to be confusing the name of an object, which is essentially a pointer into memory and a language construct -- (correction requested if I have misstated! -- and the "names" attribute of (some) objects. You can, of course, attach a "lab" or (whatever)

Re: [R] model frame and formula mismatch in model.matrix()

2013-04-15 Thread jul 2-pom
Hi Eva, you're right, it works with 50 variables. Then, how could I change this variable limit in the lm function? Thank you very much for your help. Julien. -- View this message in context: http://r.789695.n4.nabble.com/model-frame-and-formula-mismatch-in-model-matrix-tp4664093p4664226.html

Re: [R] Model selection: On the use of the coefficient determination(R2) versus the frequenstist (AIC) and Bayesian (AIC) approaches

2013-04-13 Thread Bert Gunter
This is off topic here-- it has nothing to do with R, per se. Post on a statistics list such as stats.stackexchange.com instead. -- Bert On Sat, Apr 13, 2013 at 5:41 PM, Kaptue Tchuente, Armel wrote: > Dear all, > > I'm modeling growth curve of some ecosystems with respect to their > rainfall

Re: [R] model frame and formula mismatch in model.matrix()

2013-04-13 Thread Eva Prieto Castro
Hi Julien, >From my point of view this error may be produced by the fact you are working >with a lot of variables, so the number of characters if you take them into >account as character is bigger than the system can support. Have you tried to test an example with 50 variables, for example?. S

Re: [R] Model Selection based on individual t-values with the largest possible number of variables in regression

2013-04-03 Thread Frank Harrell
To say that these strategies represent bad statistical practice is to put it mildly. Frank mister_O wrote > Dear R-Community, > > When writing my master thesis, I faced with difficult issue. Analyzing the > capital structure determinants I have one dependent variable (Total debt > ratio = TD) and

Re: [R] model fitting with lme

2013-03-01 Thread Bert Gunter
You did not get any replies because this is largely off topic. Please stop posting here and post to the r-sig-mixed-models list instead. -- Bert On Fri, Mar 1, 2013 at 9:33 AM, KAYIS Seyit Ali wrote: > (Apologise for re-sending. I am re-sending in case subject name did not give > enough informa

Re: [R] Model selection in nonstationary VAR

2013-02-23 Thread Uwe Ligges
On 23.02.2013 19:33, Arun Kumar Saha wrote: which method in statistics is completely free from model misspecification? The data. Uwe Ligges Thanks and regards, _ Arun Kumar Saha, FRM QUANTITATIVE RISK AND HEDGE CONSULTING SPECIALIST Vis

Re: [R] Model selection in nonstationary VAR

2013-02-23 Thread Arun Kumar Saha
which method in statistics is completely free from model misspecification? Thanks and regards, _ Arun Kumar Saha, FRM QUANTITATIVE RISK AND HEDGE CONSULTING SPECIALIST Visit me at: http://in.linkedin.com/in/ArunFRM __

Re: [R] model selection with spg and AIC (or, convert list to fitted model object)

2012-12-04 Thread Ravi Varadhan
: Sunday, December 02, 2012 5:04 PM To: Ravi Varadhan Cc: Adam Zeilinger (zeil0...@umn.edu); r-help@r-project.org Subject: Re: [R] model selection with spg and AIC (or, convert list to fitted model object) Dear Ravi, Thank you so much for the help. I switched to using the optimx function but I

Re: [R] model selection with spg and AIC (or, convert list to fitted model object)

2012-12-02 Thread Ben Bolker
Adam Zeilinger umn.edu> writes: > > Dear R Help, > > I have two nested negative log-likelihood functions that I am optimizing > with the spg function [BB package]. I would like to perform model > selection on these two objective functions using AIC (and possibly > anova() too). However, th

Re: [R] model selection with spg and AIC (or, convert list to fitted model object)

2012-12-02 Thread Adam Zeilinger
Dear Ravi, Thank you so much for the help. I switched to using the optimx function but I continue to use the spg method (for the most part) because I found that only spg consistently converges give different datasets. I also decided to use AIC rather that a likelihood ratio test. I have a ne

Re: [R] model frame and formula mismatch with latent class analysis poLCA

2012-11-06 Thread Galled
I've had the same problem, but although seems ridiculous I have solved by reducing the length of the name of the variables (yes the character length of each variable, e.g: if you have many variables named big_name_variable, rename it with bnv) I hope this solves your problem. __

Re: [R] Model Description

2012-09-05 Thread David Winsemius
On Sep 5, 2012, at 1:58 PM, mahout user wrote: > Hello dear, > > > I am new to R, Have developed the model for prediction. I dont know > exactly about the followed terms > residual standard error > degrees of freedom, > multiple R-squared, > adjusted R-squared > F-statistics > p-values > > T

Re: [R] model fitting

2012-02-15 Thread Tsjerk Wassenaar
Hi Tony, ?nls Cheers, Tsjerk On Feb 15, 2012 8:03 PM, "Anthony Fristachi" wrote: Greetings, Any suggestions for approaching the fitting of the function y = b/exp(a*x) + c*x + y0 where a, b, c, and y0 are unknown constants and y and x are variables in a give dataset. Thanks Tony

Re: [R] model non-nested random effects in nlme library

2012-01-23 Thread mwege
Season Individual FT FTLengthCurvIndex dir.lin 2009W GW522 1 20 0.538931977 1.8884631 2009W GW522 2 28 0.498651384 0.8379838 2010W A1841 17 0.492549537 1.23907 2010W A1842 23 0.630582873 1.30105

Re: [R] model non-nested random effects in nlme library

2012-01-23 Thread Ben Bolker
mwege gmail.com> writes: > > Hello all, > > In lme4 if you want to model two non-nested random effects you code it like > this: > > mod1 <- lmer(y~x + (1|randomvar1) + (1|randomvar2)) > > How would you go about to model something similar in nlme? > > In my database I have two variables for w

Re: [R] Model design

2011-12-16 Thread ONKELINX, Thierry
ELINX, Thierry CC: r-help@r-project.org Onderwerp: Re: [R] Model design Hi Thierry I looked at running an ANOVA but I have spatial autocorrelation in the data set as indicated by Variograms and significant moran's I i.e the cells closer together are more likely to be similar than expected unde

Re: [R] Model design

2011-12-16 Thread alfreda morinez
Hi Thierry I looked at running an ANOVA but I have spatial autocorrelation in the data set as indicated by Variograms and significant moran's I i.e the cells closer together are more likely to be similar than expected under a normal distibution - is it possible to make this approach take it into c

Re: [R] Model design

2011-12-16 Thread ONKELINX, Thierry
Dear Alfreda, anova(area_grass) will tell you IF the average grass area is different among areas. If you want to know WHICH areas are different from each other, then you have to do some multiple comparisons. You can use the multcomp package: e.g. library(multcomp) glht(area_grass, linfct = mc

Re: [R] model selection using logistf package

2011-09-27 Thread Frank Harrell
Stepwise variable selection without heavy penalization is invalid. Frank mael wrote: > > Hi everyone, > > I'm wondering how to select the "best" model when using logistf? AIC does > not work neither does anova. I tried fitting a glm model but got the > separation warning message so I tried using

Re: [R] Model Selection with Phylogenetic Independent Contrasts

2011-09-15 Thread Ben Bolker
rjswift gmail.com> writes: > > I'm trying to select a model under PCA using independent contrasts. Since > PICs need to be forced through the origin I've been using lmorigin for the > original regression, but it doesn't appear that stepAIC recognizes it. I > keep receiving an error message - "Er

Re: [R] Model selection and model efficiency - Search for opinions

2011-08-24 Thread Bert Gunter
1. As this is not really appropriate for R, I suggest replies be private. 2. You might try posting on various statistical forums, e.g. on http://stats.stackexchange.com/ -- Cheers, Bert On Wed, Aug 24, 2011 at 12:15 PM, Arnaud Mosnier wrote: > Hi, > > In order to find the best models I use AIC

Re: [R] model formula

2011-08-11 Thread Eik Vettorazzi
Am 11.08.2011 17:39, schrieb Uwe Ligges: > > > On 11.08.2011 17:27, Bond, Stephen wrote: >> Hello useRs, >> >> Pls help with removing a single interaction term from a formula: >> >> summary( >> glm.turn.2<- >> glm(cbind(turn.cnt,tot.cnt-turn.cnt)~sn+poly(relAge,2,raw=T)+termfac+rate:te

Re: [R] model formula

2011-08-11 Thread Uwe Ligges
On 11.08.2011 18:32, Eik Vettorazzi wrote: Hi Stephen, have a look at ?update.formula glm.turn.3<-update(glm.turn.2,.~.-termfac1:rate) No, "1" is a level of the variable "termfac" here. Uwe Ligges should do the trick. hth. Am 11.08.2011 17:27, schrieb Bond, Stephen: Hello useRs, Pls

Re: [R] model formula

2011-08-11 Thread Eik Vettorazzi
Hi Stephen, have a look at ?update.formula glm.turn.3<-update(glm.turn.2,.~.-termfac1:rate) should do the trick. hth. Am 11.08.2011 17:27, schrieb Bond, Stephen: > Hello useRs, > > Pls help with removing a single interaction term from a formula: > > summary( > glm.turn.2 <- > glm(cbin

Re: [R] model formula

2011-08-11 Thread Bond, Stephen
the way a glm model can be used. Thanks everybody. Stephen -Original Message- From: Uwe Ligges [mailto:lig...@statistik.tu-dortmund.de] Sent: Thursday, August 11, 2011 11:40 AM To: Bond, Stephen Cc: r-help@r-project.org Subject: Re: [R] model formula On 11.08.2011 17:27, Bond, Stephen

Re: [R] model formula

2011-08-11 Thread Uwe Ligges
On 11.08.2011 17:27, Bond, Stephen wrote: Hello useRs, Pls help with removing a single interaction term from a formula: summary( glm.turn.2<- glm(cbind(turn.cnt,tot.cnt-turn.cnt)~sn+poly(relAge,2,raw=T)+termfac+rate:termfac,data=fix, family="quasibinomial")

Re: [R] Model II regression

2011-06-27 Thread David L Carlson
Look at package smatr. It fits RMA (called here standardized major axis) regression, plots the line, and provides confidence limits. -- David L Carlson Associate Professor of Anthropology Texas A&M University College Station, TX 77843-4352 -Orig

Re: [R] Model Formulae Evaluation

2011-06-20 Thread Gabor Grothendieck
On Mon, Jun 20, 2011 at 1:31 PM, albeam wrote: > Hi everyone, > > Thank you for the help, I apologize for not "providing commented, minimal, > self-contained, reproducible code." I was looking for some pointers about > how to do this in general, but it would have been helpful for me to post a > sp

Re: [R] Model Formulae Evaluation

2011-06-20 Thread albeam
Hi everyone, Thank you for the help, I apologize for not "providing commented, minimal, self-contained, reproducible code." I was looking for some pointers about how to do this in general, but it would have been helpful for me to post a specific example. Anyway, after the feedback this is the solu

Re: [R] Model Formulae Evaluation

2011-06-20 Thread Gabor Grothendieck
On Mon, Jun 20, 2011 at 9:46 AM, Gabor Grothendieck wrote: > On Mon, Jun 20, 2011 at 9:08 AM, albeam wrote: >> Please allow me to clarify my original question. What I really need to be >> able to do it is to take arbitrary functions and evaluate them for arbitrary >> parameter values. I'm doing t

Re: [R] Model Formulae Evaluation

2011-06-20 Thread peter dalgaard
On Jun 20, 2011, at 15:08 , albeam wrote: > Please allow me to clarify my original question. What I really need to be > able to do it is to take arbitrary functions and evaluate them for arbitrary > parameter values. I'm doing the optimization myself, so I need to be able to > take a user's funct

Re: [R] Model Formulae Evaluation

2011-06-20 Thread Gabor Grothendieck
On Mon, Jun 20, 2011 at 9:08 AM, albeam wrote: > Please allow me to clarify my original question. What I really need to be > able to do it is to take arbitrary functions and evaluate them for arbitrary > parameter values. I'm doing the optimization myself, so I need to be able to > take a user's f

Re: [R] Model Formulae Evaluation

2011-06-20 Thread albeam
Please allow me to clarify my original question. What I really need to be able to do it is to take arbitrary functions and evaluate them for arbitrary parameter values. I'm doing the optimization myself, so I need to be able to take a user's function and evaluate them at the current parameter value

Re: [R] Model formula for ols function (rms package)

2011-04-12 Thread Frank Harrell
Hi Mark, You are quite correct. My apologies. That should have been rcs(x1, 3) + rcs(x2, 3) + x1 %ia% x2 or pol(x1, 2) + pol(x2, 2) + x1 %ia% x2 Frank Mark Seeto wrote: > > Thank you for your reply, Frank. %ia% drops the product x1'*x2', but > keeps x1*x2' and x1'*x2. Is there a way to drop

Re: [R] Model formula for ols function (rms package)

2011-04-12 Thread Mark Seeto
Thank you for your reply, Frank. %ia% drops the product x1'*x2', but keeps x1*x2' and x1'*x2. Is there a way to drop all three of these and include only x1*x2? Or is this not a sensible thing to want to do? Thanks, Mark Frank E Harrell Jr wrote: For the first example you want the restricted int

Re: [R] Model formula for ols function (rms package)

2011-04-12 Thread Frank Harrell
For the first example you want the restricted interaction operator: y ~ rcs(x1, 3) + rcs(x2, 3) + rcs(x1, 3) %ia% rcs(x2, 3). For the second example use pol(x,2) or something like pol(x1,2) + pol(x2,2) + pol(x1, 2) %ia% pol(x2, 2) If you have to create new variables for R formulas you're usually

Re: [R] Model checking for gam (mgcv) result

2011-04-12 Thread Simon Wood
The curve is caused by the zeroes in your data. raw.residual = response - fitted so if response=0 then raw.residual = -fitted. You get a curve, rather than a straight line, on the fitted vs residual plot because the residuals are standardised in a way that also depends on the fitted value. (

Re: [R] model fine, predict gives an error

2011-03-16 Thread Antje Niederlein
; Date: Wed, 16 Mar 2011 08:17:49 +0100 >> From: niederlein-rs...@yahoo.de >> To: r-help@r-project.org >> Subject: Re: [R] model fine, predict gives an error >> >> Anybody who can help me with this issue? > > did you post your data? I was curious so I thought I ma

Re: [R] model fine, predict gives an error

2011-03-16 Thread Antje Niederlein
Anybody who can help me with this issue? On 15 March 2011 14:15, Antje Niederlein wrote: > Hi there, > > I try to model some dose response curves (drc-package). In most cases > it is fine but now I got some data which produces me the following > error: > > load("drmData.RData") > library(drc)

Re: [R] Model fitting

2010-09-15 Thread Erik Iverson
Diogo B. Provete wrote: I have a data set and I want to procedure to model fitting (e.g., Poisson, Gausian, binomial, quasipoisson etc.). I'd like to know if there is an easier way to do this in R. Easier than what ? There is no shortage of R functions and packages to fit almost any type of

Re: [R] Model averaging with (and without) interaction terms

2010-09-15 Thread Ben Bolker
Leslie Young gmail.com> writes: > > I’ve used logistic regression to create models to assess the effect of > 3 variables on the presence or absence of a species, including the > interaction terms between variables and model averaging using MuMI: > model.avg > > The top models (delta<4) include

Re: [R] model fit

2010-08-03 Thread aline uwimana
AIC(sum.coef7) Erreur dans UseMethod("logLik") : pas de méthode applicable pour "logLik" I tried but no usemethod("loglik")-> svyglm doesn't use Likelihood. 2010/8/3 Brad Fulton > Hi Rwanuza > > > > Here is the code I used to calculate the BIC score from the AIC score > > > > Model.1=svyglm(a

Re: [R] Model validation and penalization with rms package

2010-06-28 Thread Charles C. Berry
On Tue, 29 Jun 2010, Mark Seeto wrote: I’ve been using Frank Harrell’s rms package to do bootstrap model validation. Is it the case that the optimum penalization may still give a model which is substantially overfitted? I calculated corrected R^2, optimism in R^2, and corrected slope for variou

Re: [R] model selection, lme

2010-04-29 Thread kMan
Dear Kay, It is not an issue of whether it is "allowed". The issue is understanding what comparisons are taking place between the models. Your advisor should help with that. Perhaps you had a more focused question related to R? Sincerely, KeithC. -Original Message- From: Kay Cichini [ma

Re: [R] Model matrix using dummy regressors or deviation regressors

2010-02-10 Thread John Fox
om] On Behalf Of > bluesky...@gmail.com > Sent: February-09-10 11:44 PM > To: John Fox > Cc: r-h...@stat.math.ethz.ch > Subject: Re: [R] Model matrix using dummy regressors or deviation regressors > > On Tue, Feb 9, 2010 at 6:09 PM, John Fox wrote: > > Dear bluesky315, > &

Re: [R] Model matrix using dummy regressors or deviation regressors

2010-02-09 Thread bluesky315
On Tue, Feb 9, 2010 at 6:09 PM, John Fox wrote: > Dear bluesky315, > > There are several ways in R to determine regressors associated with factors. > One way is to set the global contrasts option. To get "deviation" > regressors, use options(contrasts=c("contr.sum", "contr.poly")), and see > ?opti

Re: [R] Model matrix using dummy regressors or deviation regressors

2010-02-09 Thread John Fox
Dear bluesky315, There are several ways in R to determine regressors associated with factors. One way is to set the global contrasts option. To get "deviation" regressors, use options(contrasts=c("contr.sum", "contr.poly")), and see ?options and ?contrasts for details. Also see Section 11.1.1 of t

Re: [R] Model matrix using dummy regressors or deviation regressors

2010-02-09 Thread David Winsemius
On Feb 9, 2010, at 6:33 PM, bluesky...@gmail.com wrote: The model matrix for the code at the end the email is shown below. Since the model matrix doesn't have -1, I think that it is made of dummy regressors rather than deviation regressors. I'm wondering how to make a model matrix using deviati

Re: [R] Model

2010-01-19 Thread Walmes Zeviani
Jim, Did you read the posting guide? Did you do a google search, for example, with terms like "[R] generalized linear models", "[R] count models", "[R] poisson regression"? I think you should do. Walmes. - ..oooO ..

Re: [R] Model

2010-01-19 Thread Jim Silverton
Hello, I have a barchart. The y-axis represents counts and thex-axis is divided into 10 equal intervals ranging fronm 0 to 0.1, 0.1 to 0.2, ..0.9 to 1.0. Is there a way to model the counts in R? thanks, Jim [[alternative HTML version deleted]] _

Re: [R] model simplification using Crawley as a guide

2010-01-05 Thread hpdutra
So here is some information that I hope gets criticized by the higher-intelligences that posted on this topic. Beware that I'm not a statistician and I'm just saying about what I think is correct. First, before fitting any model, check the distribution of your data, in some cases a simple anova i

Re: [R] model matrix with a spline

2009-12-19 Thread David Winsemius
On Dec 19, 2009, at 2:22 AM, David Hugh-Jones wrote: Hi all I want to get the design matrix for a model, evaluated at a single value. For example, if I pass in a data frame with a=2, b=2, y=3, and my model is y ~ a+b+a:b, then I would like to get the values 3, 2, 2, 4 out. I can do this wit

Re: [R] model based clustering with flexmix

2009-11-09 Thread Bettina Gruen
In your model driver truncatedmodel() the fit function looks like: z...@fit <- function(x, y, w) { para <- list(mean = mean(x), sd = sd(x), lower = lower, upper= upper) para$df <- 4 with(para, eval(z...@definecomponent)) } w are the a-posteriori probabilities and denote the weights with which o

Re: [R] model simulation

2009-09-07 Thread David Winsemius
On Sep 7, 2009, at 1:55 PM, Rafael Moral wrote: Dear useRs, Is there a package or a function able to simulate models with sets of differential equations? Where we could input our model and give R some value to start with and it would generate the graphs? Your request seems a bit on the

Re: [R] model simulation

2009-09-07 Thread Ben Bolker
Rafael Moral yahoo.com.br> writes: > > Dear useRs, > > Is there a package or a function able to simulate models with sets of differential equations? > Where we could input our model and give R some value to start with and it would generate the graphs? > > Regards, > Rafael. > install.packag

Re: [R] Model fitting with GAM and "by" term

2009-06-24 Thread Gavin Simpson
On Tue, 2009-06-23 at 14:18 -0400, Paul Simonin wrote: > Hello R Users, > I have a question regarding fitting a model with GAM{mgcv}. I have data > from several predictor (X) variables I wish to use to develop a model to > predict one Y variable. I am working with ecological data, so have data

Re: [R] model fitting using by(): how to get fitted values?

2009-05-06 Thread Duncan Murdoch
On 06/05/2009 8:22 AM, xavier.char...@free.fr wrote: Hi all, I'm doing nonlinear regressions on data with several factors. I want to fit say a logistic curve with different parameter values for each factor level. So I'm doing something like: tmp <- by( myData, list(myFactor1, myFactor2), func

Re: [R] model selection using ANOVA

2009-03-31 Thread Stephan Kolassa
Hi Alina, your approach sounds problematic - you can always get a smaller RSS if you add terms to your model, so your approach will always go for larger models, and you will end up overfitting. Consider information criteria, e.g., AIC or BIC, which "penalize" larger models. References for AIC

Re: [R] Model building using lmer

2008-12-17 Thread ONKELINX, Thierry
Dear Luciano, The "1" in (1|NestID) indicates only a random intercept. Note that in most models in R, a "1" on the righthandside of the formula indicates the intercept, "-1" or "0" indicates no intercept. ~X, which is equivalent to ~X + 1, indicates a slope along X and an intercept. Hence a random

Re: [R] model II regression - how do I do it?

2008-08-29 Thread Dylan Beaudette
PM > To: r-help@r-project.org > Cc: Mark Difford > Subject: Re: [R] model II regression - how do I do it? > > On Friday 29 August 2008, Mark Difford wrote: >> Hi Danilo, >> >> >> I need to do a model II linear regression, but I could not find out >> >>

Re: [R] model II regression - how do I do it?

2008-08-29 Thread Michael Grant
-project.org Cc: Mark Difford Subject: Re: [R] model II regression - how do I do it? On Friday 29 August 2008, Mark Difford wrote: > Hi Danilo, > > >> I need to do a model II linear regression, but I could not find out > >> how!! > > The smatr package does so-called mo

Re: [R] model II regression - how do I do it?

2008-08-29 Thread Mark Difford
Hi Dylan, >> While this topic is fresh, are there any compelling reasons to use Model >> II >> regression? The fact that it is the type of regression used in principal component analysis makes it a compelling method. Compelling reason? It is used to take account of measurement errors in both y

Re: [R] model II regression - how do I do it?

2008-08-29 Thread Dylan Beaudette
On Friday 29 August 2008, Mark Difford wrote: > Hi Danilo, > > >> I need to do a model II linear regression, but I could not find out > >> how!! > > The smatr package does so-called model II (major axis) regression. > > Regards, Mark. While this topic is fresh, are there any compelling reasons to

Re: [R] model II regression - how do I do it?

2008-08-29 Thread Mark Difford
Hi Danilo, >> I need to do a model II linear regression, but I could not find out how!! The smatr package does so-called model II (major axis) regression. Regards, Mark. Danilo Muniz wrote: > > I need to do a model II linear regression, but I could not find out how!! > > I tryed to use the

Re: [R] model II regression - how do I do it?

2008-08-29 Thread Mark Difford
Hi Danilo, >> I need to do a model II linear regression, but I could not find out how!! The smatr package does so-called model II (major axis) regression. Regards, Mark. Danilo Muniz wrote: > > I need to do a model II linear regression, but I could not find out how!! > > I tryed to use the

Re: [R] model II regression - how do I do it?

2008-08-29 Thread Michael Grant
Dear Danilo: Here is one approach with the formal reference being: Computational Statistics & Data Analysis 23 ( 1997 ) 355-372 COMPUTATIONAL STATISTICS & DATA ANALYSIS Generalization of the geometric mean functional relationship Norman R. Draper, Yonghong (Fred) Yang Department of Statistics, 12

Re: [R] model II regression - how do I do it?

2008-08-29 Thread Gavin Simpson
On Fri, 2008-08-29 at 15:37 -0200, Danilo Muniz wrote: > I need to do a model II linear regression, but I could not find out how!! > > I tryed to use the lm function, but I did not discovered how to specify the > model (type I or type II) to the function... could you help me? Jari Oksanen and Pie

Re: [R] model mix problem. FALSE CONVERGENCE

2008-08-11 Thread Spencer Graves
Hello: I have not seen a reply to this email, so I will offer a couple of suggestions. The error "false convergence" often means that the model is overparameterized. Sometimes, specifying lme(..., control = list(returnObject=TRUE)) will convert this type of error into a warning. If th

  1   2   >