similar to: Simple question about formulae in R!?

Displaying 20 results from an estimated 3000 matches similar to: "Simple question about formulae in R!?"

2006 May 02
4
useful bit of code (hopefully)
Hi, I often find myself using bits of code like this inside ActiveRecord, perhaps it''s useful for others, or others can improve on it: ########### # fix user input before validating it before_validation :sanitize_input # santize input before actual validation is called # this uses the little methods defined below def sanitize_input trim %w(adres postcode woonplaats email naam
2008 Nov 14
1
Line breaks in mathematical formulae in Rd files (PR#13287)
Hi, This is a problem about writing R documentation (R-exts 2.6). The command "\deqn" defined in "Rd.sty" is: \newcommand{\deqn}[2]{\[#1\]} which will put mathematical formulae in the "displaymath" environment; that means line breaks are not allowed (or will not be shown) in formulae, but sometimes we do need multiple lines of formulae. One solution is to write
2008 May 30
4
Request: Documentation of formulae
In working through material on p.272 of MASS (4th ed.), I came across the following model formula: pet1.lm <- lm(Y ~ No/EP - 1, Petrol) I was at a loss to understand the use of "/" until I looked in "An Introduction [!] to R," where I found the explanation. My request is that more complete material on model formulae be lifted from "Introduction to R" (or
2008 Feb 12
2
Formulae for R functions
Can someone direct me to a resource or resources that list the formulae used by R functions (i.e. predict.lm ) to calculate the statistic reported. I am not a programmer and studying the r code is extremely slow going. I have searched r-project.org and all the function help files without success. For example I have attempted to replicate by hand the se.fit calculation from a lm object
2000 Feb 03
2
How to include TeX formulae in R plots?
Hi, all Does anybody know if it is possible to include TeX-style formulae in R plots? The aim is to export such plots to LaTeX documents using the postscript() device. Many thanks in advance, Alberto Munoz --------------------------------------------------------------------- Alberto Munoz Phone: +34-91- 624 95 79 Dpto. de Estadistica y Econometria Fax: +34-91- 624
2000 Jun 02
1
test for a formulae
I'd like to check within a whether an argument is a formulae of the type ~X or similar. What's the right way to do so? I'm using: is.language(obj) but not sure this is right Thanks in advance P.J. Paulo Justiniano Ribeiro Jr Dept Maths & Stats - Fylde College Lancaster University Lancaster LA1 4YF - U.K. e-mail: paulojus at est.ufpr.br http://www.maths.lancs.ac.uk/~ribeiro
2003 Jan 21
1
Orders of terms in formulae
Hi, Given that R reports Type I sums of squares, isn't it a bit anachronistic that it re-orders terms in formulae? > d <- expand.grid(y=rnorm(8), + A=factor(c(1,2)), + B=factor(c(1,2)), + C=factor(c(1,2))) > summary(aov(y ~ A+B+A:B+C,data=d)) Df Sum Sq Mean Sq F value Pr(>F) A 1 8.294e-34 8.294e-34 1.027e-33 1
2009 May 16
1
ggplot2: annotating plot with mathematical formulae
Hi, Is there a way of annotating a ggplot plot with mathematical formulae? I can do geom_text(aes(label="some text", ... but I can't do geom_text(aes(label=expression(x^{n-1}), ... It gives the error Error: geom_text requires the following missing aesthetics: label Is there a convenient equivalent? Cheers, Paul
2011 Jun 20
2
Model Formulae Evaluation
Hello All, I have searched but haven't been able to find an answer to this question. I'm writing a function that needs to be able evaluate the right-hand side of a general non-linear formula for different parameter values, similar to what nls() does. I looked through the nls() code but it isn't clear what is going on. Could someone point me to a reference or a way I might do this?
2010 Apr 06
2
Extracting formulae from expression() / deriv()
I am attempting to extract the derivative/ gradient from this expression df1p <- deriv(f1, "P") > df1p expression({ .value <- s - c - a * P .grad <- array(0, c(length(.value), 1L), list(NULL, c("P"))) .grad[, "P"] <- -a attr(.value, "gradient") <- .grad .value }) So in this case I want to extract the "-a".
2009 Dec 10
1
updating arguments of formulae
Dear R-Community, I am relatively new with R, so sorry for things which for you might be obvious... I am trying to automatically update lmer formulae. the variables of the model are: depM= my dependent measure Sb2= a random factor OS = a predictor VR= another predictor So, I am building the first model with random intercept only: model = lmer(depM ~ (1 |Sb2)) then I update the formula
2018 Apr 04
0
SCEV and LoopStrengthReduction Formulae
> cmpq %rbx, %r14 > jne .LBB0_1 > > LLVM can perform compare-jump fusion, it already does in certain cases, but > not in the case above. We can remove the cmp above if we were to perform > the following transformation: Do you mean branch-fusion (https://en.wikichip.org/wiki/macro-operation_fusion)? Is there any more limitation why these two or not fused? > -----Original
2009 Jul 15
1
interacting variables in a formulae in R
Dear R Mailing Subscribers, I just have a question of how R handles interacting variables in model creation using glm for instance. if I write : >> model=glm(solution~descriptor1+descriptor2+descriptor3,family=binomial(link="logit")) I should end up with coefficients for a logistic model that I can introduce easily in the mathematical form of such a model (weighted sum of
2017 Mar 30
0
get_all_vars() does not handle rhs matrices in formulae
Hello again, It appears that get_all_vars() incorrectly handles model formulae that use a right-hand side (rhs) matrix. For example, consider these two substantively identical models: # model using named variables mpg <- mtcars$mpg wt <- mtcars$wt hp <- mtcars$hp m1 <- lm(mpg ~ wt + hp) # model using matrix y <- mtcars$mpg x <- cbind(mtcars$wt, mtcars$hp) m2 <- lm(y ~ x)
2010 Oct 24
3
Long model formulae
What is a good way to enter a very long model formula. For example: y ~ Input.2 + Input.3 + ... + Input.1000 (assuming the corresponding dataframe has many other columns). Is there a way to convert a character string to a formula? Are there command line expansions in R besides the simple '.'? Thanks. [[alternative HTML version deleted]]
2002 Aug 30
4
Intercept in model formulae.
Hi, I'm trying to create a linear model for a dataset that has a breakpoint e.g. # dummy dataset x <- 1:20 y <- c(1:10,seq(10.5,15,0.5)) plot(x,y) I've modelled this using the following formula: temp <- lm(y ~ x*(x<=10)+x*(x>10)) I want to be able to omit the intercept (i.e. force the line through zero) from the first of these segments (x<=10) so that I'm only
1997 May 06
1
R-beta: formula() and model formulae
Several bugs (no solutions, yet). These might be well known. 1) If one does, e.g., mymod <- lm(y ~ x); formula(mymod) then one does not get back the formula (one gets, Error: invalid formula) 2) if x is of mode numeric, then the model formula mymod <- lm(y ~ x + x^2) is not processed as S would do it. The model is fit ignoring the x^2 term, however mymod$call includes the x^2 term.
1997 May 06
1
R-beta: formula() and model formulae
Several bugs (no solutions, yet). These might be well known. 1) If one does, e.g., mymod <- lm(y ~ x); formula(mymod) then one does not get back the formula (one gets, Error: invalid formula) 2) if x is of mode numeric, then the model formula mymod <- lm(y ~ x + x^2) is not processed as S would do it. The model is fit ignoring the x^2 term, however mymod$call includes the x^2 term.
2006 Jul 04
1
Problems on testing moderating effect (or interactive effect).
Hi everyone, I want to do test on moderating effect. I have three factors, A, B, and C. A has influence on B, and C moderating the influence. The relationship looks like this: A -----> B ^ | C A, B, and C are all scale variables. I think I can test the moderating effect by adding a interactive variable between A and C. But I'm not sure how to do. Is there a default way to
2005 Sep 10
4
Mailinglist moderation
Hi, I think the time (150 messages and counting) has come to ask someone of the CentOS team to start moderating this list. I don't mind people discussing whatever topic they like, but not at the expense of the mailinglist and its members. I don't think the topic really doesn't matter in these discussions, and if done in private they would stand for long anyway. I would propose