search for: model_1

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

Did you mean: model1
2012 Sep 04
5
Associations and Math between Models
I''ve setup two models, 1 and 2, that are associated by has_and_belongs_to_many. I''m trying to get an attribute from model_1 to use in a method in model_2. When I use the code below, I get an error saying ''undefined method model_1_id''. What am I missing? Thanks! Model_2.rb Class Model_2 < ActiveRecord::Base ... has_and_belongs_to_many :model_1 def some_method attr_a * Model_1.find(model_1_id)...
2005 Aug 15
1
error in predict glm (new levels cause problems)
Dear R-helpers, I try to perform glm's with negative binomial distributed data. So I use the MASS library and the commands: model_1 = glm.nb(response ~ y1 + y2 + ...+ yi, data = data.frame) and predict(model_1, newdata = data.frame) So far, I think everything should be ok. But when I want to perform a glm with a subset of the data, I run into an error message as soon as I want to predict values, based on the new model. The p...
2006 Aug 26
1
problems with loop
...2]=Min$par[2] res[s,3]=Min$par[3] res[s,4]=Min$par[4] res[s,5]=Min$value[1] } return(res) } # function to create a new data set. Works fine on its own new.set=function() { tmp=matrix(nrow=510,ncol=2) v=numeric() sim=Model_1(1.2761707, 0.1953354, 2.7351930, 0.1032929) tmp[,1]=sample(sim[,1],510,replace=T) v=runif(510,0,1) for (k in 1 : 510) { for (n in 1 : length(sim[,1])) { if (tmp[k,1]==sim[n,1] && v[k]<=sim[n,2]){tmp[k,2]=1}...
2005 Aug 16
1
predict nbinomial glm
...a solution to this problem? Thank you in advance, K. Steinmann (working with R 2.0.0) Code: library(MASS) a <- rnbinom(200, 1, 0.5) b <- (1:200) c <- (30:229) d <- rep(c("q", "r", "s", "t"), rep(50,4)) data_frame <- data.frame(a,b,c,d) model_1 = glm.nb(a ~ b + d , data = data_frame) pred_model_1 = predict(model_1, newdata = data_frame, type = "response", se.fit = FALSE, dispersion = NULL, terms = NULL) subset_of_dataframe = subset(data_frame, (b > 80 & c < 190 )) model_2 = glm.nb(a ~ b + d , data = subset_of_dat...
2006 Jul 28
2
negative binomial lmer
...all but one effect, for all effects). However, for negative binomially distributed data, I need to estimate the parameter theta. I have been doing this by using a negative binomial glm of the same model (except that all the effects are fixed), and estimating mu as the fitted model like so: model_1 <-glm.nb(y~x1+x2+x3, data = datafilename) mu_1 <- fitted(model_1) theta_1 <- theta.ml(y, mu_1, length(data), limit = 10, eps = .Machine$double.eps^0.25, trace = FALSE) Then, I conduct the lmer, using the estimated theta: model_11 <-lmer(y~x1+x2+(1|x3), family = negative...
2009 Jun 26
1
Alternate error structures in lme4?
Hi R users, The nlme library enabled several alternate error structures useful for longitudinal or repeated-measures data. For example, a continuous AR(1) process: model_2 = update(model_1, correlation = corCAR1(form = ~ time | subject)) Does anybody know if this is available in lme4? Thank you Ben -- View this message in context: http://www.nabble.com/Alternate-error-structures-in-lme4--tp24226643p24226643.html Sent from the R help mailing list archive at Nabble.com.
2009 Mar 18
1
error with effects package.
Dear R helpers, I have the following model model_1<-glm(y~A+B+C+E+A:D,contrasts=list(D=contrasts_D),data=mydata,na.action=na.omit) with: options(contrasts=c("contr.sum", "contr.poly")) A,B and E are 2-levels factor, C is covariate, D is 20 levels factor with 10 in relation with the first levels of factor A, the other in...
2005 Dec 05
3
Noob Question about databases in rails
Ok, This sounds like it should be easy but I am having a hard time with it. I am making a website but I''m trying to make everything in it fairly database driven, this is really pretty much my first rails project. I have a table called ''nav_items'' to display the nav choices, but there is also other dynamic data on the homepage such as the ''events''
2007 Aug 20
1
Q: combine 2 data frames with missing values
Een ingesloten tekst met niet-gespecificeerde tekenset is van het bericht gescrubt ... Naam: niet beschikbaar Url: https://stat.ethz.ch/pipermail/r-help/attachments/20070820/920567a6/attachment.pl
2007 Aug 21
2
Partial comparison in string vector
...t a diferent test. Now i select a subsets of variables out of the original dataset, and use : value_x1 = subset(dataset_1,select=lg_value) value_y1 =subset(dataset_2,select=lg_value) Then i to mold an lm model, inorder to get estimates for the slope ans intercept model_1 <- lm (value_y1[,1]~ value_x1[,1] ) This is what R tell's me: "Error in model.frame(formula, rownames, variables, varnames, extras, extranames, : variable lengths differ (found for 'value_x1[, 1]')" Is there p...