search for: mymodel

Displaying 20 results from an estimated 238 matches for "mymodel".

Did you mean: mcmodel
2008 Jul 25
21
Problems with mock assigned to a constant
...ly state my problem: http://gist.github.com/2372 This is a snip of a some code from a library I''m writing. When I run this spec I get the following: # spec migration_spec.rb .F 1) Spec::Mocks::MockExpectationError in ''Migration should find the records'' Mock ''MyModel Class'' received unexpected message :count with (no args) ./migration.rb:14:in `run'' ./migration_spec.rb:19: Finished in 0.009164 seconds 2 examples, 1 failure ------------------------------------------ I want to mock out MyModel completely because it''s an ActiveRecord...
2009 Sep 05
2
Anova over a list of models
I have a list object, in which I have stored n lme4-models. For example: library(lme4); myModels <- list(); myModels[1] <- lmer(Reaction ~ Days + (Days|Subject), sleepstudy) myModels[2] <- lmer(Reaction ~ Days + (1|Subject) + (0+Days|Subject), sleepstudy) Now I would like to perform an anova over all models in the list. However, the anova function requires that every model is insert...
2013 May 21
1
Calculating AIC for the whole model in VAR
Hello! I am using package "VAR". I've fitted my model: mymodel<-VAR(mydata,myp,type="const") I can extract the Log Liklihood for THE WHOLE MODEL: logLik(mymodel) How could I calculate (other than manually) the corresponding Akaike Information Criterion (AIC)? I tried AIC - but it does not take mymodel: AIC(mymodel) # numeric(0) Thank you! --...
2018 May 18
3
Exporting to text files
I have dose response data analyzed with the package 'drc'. 'summary(mymodel)' prints my kinetic parameters. I want that text in an ASCII text file. I want to get exactly what I would get if I copied and pasted from the terminal window. I've read the documentation on data export to text files here: https://cran.r-project.org/doc/manuals/r-release/R-data.html#Expo...
2010 Jan 01
1
Questions bout SVM
Hi everyone, Can someone please help me in these questions?: 1)if I use crossvalidation with svm, do I have to use this equation to calculate RMSE?: mymodel <- svm(myformula,data=mydata,cross=10) sqrt(mean(mymodel$MSE)) But if I don’t use crossvalidation, I have to use the following to calculate RMSE: mymodel <- svm(myformula,data=mydata) mytest <- predict(mymodel, mytestdata) error <- mytest - mytest...
2006 Nov 16
2
dynamically adding static (class) methods to a class
Hello again, I guess this is more of a Ruby question, but here goes anyways... I want to intercept all calls to non existent class methods and then call an existing class method with the non existent name. In code... class MyModel < ActiveRecord::Base def MyModel.method_missing(symbol, *args) MyModel.func(symbol.id2name) end def MyModel.func(func_called) puts "You called #{func_called}" end end When I try this code, it gets lost in recursion. Thanks for the help. --~--~---------~--~----~--...
2008 Apr 17
1
How to extract vectors from an arima() object and into a data frame?
This should be very easy, but alas, I'm very new to R. My end goal is to calculate p-values from arima(). Let's say I just ran this: > MyModel <- arima(y[1:58], order=c(1,0,0), xreg=MyData[1:58,7:14], > method="ML") > MyModel And I see: arima(x = y[1:58], order = c(1, 0, 0), xreg = MyData[1:58, 7:14], method = "ML") Coefficients: ar1 intercept x1 x2 x3 x4 x5 x6...
2011 Apr 30
0
bootcov or robcov for odds ratio?
Dear list, I made a logistic regression model (MyModel) using lrm and penalization by pentrace for data of 104 patients, which consists of 5 explanatory variables and one binary outcome (poor/good). Then, I found bootcov and robcov function in rms package for calculation of confidence range of coefficients and odds ratio by bootstrap covariance matrix...
2018 May 18
0
Exporting to text files
?sink On May 18, 2018 9:47:25 AM PDT, Ed Siefker <ebs15242 at gmail.com> wrote: >I have dose response data analyzed with the package 'drc'. >'summary(mymodel)' prints my kinetic parameters. I want >that text in an ASCII text file. I want to get exactly what I >would get if I copied and pasted from the terminal window. > >I've read the documentation on data export to text files here: >https://cran.r-project.org/doc/manuals/r-rele...
2012 Oct 31
2
Problema con la función lm
Buenos días: Tengo un determinado código en R que en una máquina funciona correctamente, pero en otra devuelve un error del tipo "Error en as.formula(mymodel): Objeto ''mymodel'' no encontrado''" En mi código: mymodel <- "y ~ x1[, 1] + x2[, 1]" res <- lm (as.formula(mymodel)) ¿Qué puede estar motivando ese error?. La máquina en la que falla tiene una versión de tseries que es anterior a la de otra máquina;...
2006 May 04
1
Instance or local vars for field helpers in partial template
I''m getting confused. If I have a view (.rhtml), I can use a field helper like: <%= text_field :mymodel, :attribute %> This uses the value from @mymodel.attribute Now, if I am rendering a template normally (i.e. not partial), I would expect @mymodel to be a model object defined as an instance variable in the controller. However, if I am rendering a partial template, I either have: render :...
2010 Dec 29
2
Referring to an object name from within a function
Can anyone show me how to refer to an object name that is passed to a function, from within the function? For example: MyModel <- 1 test <- function(x) { if(x == 1) {cat("x is a valid object.\n")} } test(x) What I would like this to do is pass MyModel to function test, and if it passes a test, be able to print "MyModel is a valid object." Thanks. -- View this message in context: http://r...
2007 Sep 12
3
Can''t disable ferret when running in Mongrel
In my environment.rb I say the following: MyModel.disable_ferret puts MyModel.ferret_enabled? The console works as expected: script/console false >> MyModel.ferret_enabled? => false I can then edit an instance, ferret remains disabled and the changes are not immediately indexed. However, when I start mongrel Ferret is initially dis...
2011 Feb 12
2
Predictions with missing inputs
...(just use the estimated coefficients for these variables in making predictions and ignoring the coefficient on X3). Here's my attempt but, of course, didn't work. #fit some linear model to random data x=matrix(rnorm(100*3),100,3) y=sample(1:2,100,replace=TRUE) mydata <- data.frame(y,x) mymodel <- lm(y ~ ns(X1, df=3) + X2 + X3, data=mydata) summary(mymodel) #create new data with 1 missing input mynewdata <- data.frame(matrix(rnorm(100*2),100,2)) mypred <- predict(mymodel, mynewdata) Thanks in advance for your help! Axel. [[alternative HTML version deleted]]
2006 Feb 28
12
Examples for Money library ?
Can anybody share some examples of their Money implementation ? I''m trying to setup a Model to use this library, but can''t seem to wrap my head around how it is exactly supposed to work. My Model (Foo) looks like: =============== composed_of :commission, :class_name => "Money", :mapping => [ %w(commission_cents cents), %w(commission_currency currency) ] Yet, in
2005 Apr 24
2
Model names in controllers
...e excuse yet another newbie question... I''m getting this error: MissingSourceFile in <controller not set>#<action not set> c:/program files/ruby/lib/ruby/gems/1.8/gems/actionpack-1.8.1/lib/action_controller/dependencies.rb:75:in `require_dependencies'': Missing model MyModel.rb From these lines of code: class MyModelController < ApplicationController model :MyModel end The model''s file name is my_model.rb. If I rename the file to MyModel.rb it works, or if I change the line of code to model :my_model it works. I used the generator for the model so i...
2010 Oct 29
2
how to debug (mtrace) a function defined inside a function?
Hi, everyone. I am using a fair amount of closures in my code. Problem i am experiencing is i cannot figure out how to mtrace functions defined within a function. There must be some way to name such function for mtrace to see it and let me step into it. For example, say i have code mymodel<-function(){ data<-numeric(0) build<-function(){ data<<-1 } m<-list() m$build<-build m } How do I mtrace build function defined inside mymodel function so that i can step into build? -- View this message in context: http://r.789695.n4.nabble.com/how-to-debug-mtrac...
2005 May 04
3
How to intepret a factor response model?
...real_var = c(rnorm(150), rnorm(150) + 5)) > summary(mydata) factor_var real_var one :100 Min. :-2.742877 three:100 1st Qu.:-0.009493 two :100 Median : 2.361669 Mean : 2.490411 3rd Qu.: 4.822394 Max. : 6.924588 > mymodel = glm(factor_var ~ real_var, family = 'binomial', data = mydata) > summary(mymodel) Call: glm(formula = factor_var ~ real_var, family = "binomial", data = mydata) Deviance Residuals: Min 1Q Median 3Q Max -1.7442 -0.6774 0.1849 0.3133 2.1187...
2010 Nov 22
3
save a regression model that can be used later
...ne I have a question about how to save a regression model in R and how to retrieve it for making predictions in a new session. To be more specific, I fitted a multilevel logistic regression model using the lmer from the "lme4" package. I then successfully make predictions using fitted(mymodel). Since data are complex (three levels, nested, numerous categorical and continuous data describing types of laparoscopic surgery), the computer takes quite a while to fit the MLM model. I wonder whether it's possible to save the fitted model so that I don't have to fit it again for makin...
2006 Jul 24
1
Undo "script/generate model mymodel"
Is there a way to undo this? because mymodel wasn''t a model, but only a class... :)