similar to: IF STATEMENTS

Displaying 20 results from an estimated 8000 matches similar to: "IF STATEMENTS"

2009 Jul 28
2
formatting in r
Hello, I have output that I want to print out. I am having a few issues. 1] output u to power is really nothing more than a 2 x 11 set of values formed using cbind function and printed out as a data frame How can I get it to output over several lines such as seen here? 2] Critical Z etc. were added by hand. I need an example of how I can mix alphanumeric and numeric data on
2009 Jul 25
4
graphs
Hello, I am plotting two distributions and want to draw a vertical line at the critical point 149. How can I stop it from going further up than the norm(140,15) curve? x<-seq(75,225,0.1) plot(x,dnorm(x,mean=140, sd=15), type='l', col='navy') abline(v = 149, col = "black") curve(dnorm(x,mean=150, sd=15),from=75, to=225, col='orange', add=TRUE) Thank you.
2009 Jul 09
2
naming of columns in R dataframe consisting of mixed data (alphanumeric and numeric)
Hello, I have an r function that creates the following dataframe tresults2. Notice that column 1 does not have a column heading. Tresults2: [,1] estparam 18.00000 nullval 20.00000 . . . ciWidth 2.04622 HalfInterval 1.02311 pertinent code: results<-cbind( estparam, nullval, t, pv_left, pv_right, pv_two_t, estse, df, cc, tbox, llim, ulim, ciWidth,
2009 Jul 23
2
mathematical notation in R
Does this approach what you're looking for? See ?is.finite for more info > LBAuo<- -9999 > LBAuo [1] -9999 > if (LBAuo <= -9999) LBAuo <- -Inf > LBAuo [1] -Inf > HTH Steven McKinney > -----Original Message----- > From: r-help-bounces at r-project.org [mailto:r-help-bounces at r- > project.org] On Behalf Of Mary A. Marion > Sent: Wednesday, July 22, 2009
2012 Jul 03
3
design matrix creation in R
Hello, I want to create a design matrix using R. Can you explain the code which creates the following please? I understand the first part. b=g1(?) does what? dd <- data.frame(a = gl(3,4), b = gl(4,1,12)) # balanced 2-way dd a b 1 1 1 2 1 2 3 1 3 4 1 4 5 2 1 6 2 2 7 2 3 8 2 4 9 3 1 10 3 2 11 3 3 12 3 4 I am using the tree dataset in R. I want to form a reparameterized design
2009 Mar 20
2
print of objects in R
Hello, I have been watching my output as I create functions and do other things in r. One thing I don't like is the [1,] type notation at the beginning of a line. I have been able to change that to a number such as 1 2 etc. using as.data.frame(object). How can I stop the printing of a line number and column heading if I want to? I am thinking about publishing and writing of papers.
2011 Nov 01
2
drawing ellipses in R
Hello, I have been following the thread dated Monday, October 9, 2006 when Kamila Naxerova asked a question about plotting elliptical shapes. Can you explain the equations for X and Y. I believe they used the parametric form of x and y (x=r cos(theta), y=r sin(theta). I don't know what r is here ? Can you explain 1)the origin of these equations and 2) what is r? Sincerely, Mary A. Marion
2010 Oct 29
2
plot pdf
I want to plot the unstadardized version of a normal plot.  Can you explain why that is not working? Dev.set(1) xcrit=-1.645 cord.x <- c(-3,seq(-3,xcrit,0.01),xcrit) cord.y <- c(0,dnorm(seq(-3,xcrit,0.01)),0)            # what does final 0 do here? curve(dnorm(x,0,1),xlim=c(-3,3),main='Normal PDF') polygon(cord.x,cord.y,col='orange')
2010 Nov 20
1
extraction of element
Hello, I want only the value of Beta so the statement? Power<-1-Beta[1] works right. How to do?? See code below Beta <- integrate(dnorm,mean=0,sd=1, 2.3552,Inf) Power<- 1-Beta[1] Sincerely, Mary A. Marion
2012 Oct 23
1
Minimizing Computational Time
Dear R-users, May I seek some suggestions from you. I have a long programme written in R with several 'for' loops inside. I just want to get them out by any elegant way (if there is!) to reduce the computational time of the main programme. For instance, is there any smart way for the following programme that will lessen time?
2013 Mar 11
2
vertical lines in R plot
Dear All, May I seek your suggestion on a simple issue. I want to draw vertical lines at some positions in the following R plot. To be more specific, I wish to draw vertical lines at d=c(5.0,5.5,6) and they should go till p=c(0.12,0.60,0.20) . I haven't found any way out, though made several attempts. Please run the following commands first if you are interested in!
2005 Mar 02
1
Warning: number of items to replace is not a multiple of replacement length
I feel like a complete dolt, as I know this question has been asked by others on a fairly regular basis, but I'm going in circles trying to get the following to work: id.prob<-function (tt) { library(mvtnorm) #============================ Makeham<-function(tt) { a2=0.030386513 a3=0.006688287 b3=0.039047537 t<-tt-20 h.t<-a2+a3*exp(b3*t) S.t<-exp(-a2*t+a3/b3*(1-exp(b3*t)))
2017 Jun 13
3
understanding I() in lmer formula
Is there a difference between I(x*y) and I(y*x) ? I have a call to lmer that results in this complaint: Error in is.alpha2.subordinate * ~z.min.co.res : non-numeric argument to binary operator when I change this line: I(is.alpha2.subordinate*z.min.co.res)+ to this: I(z.min.co.res*is.alpha2.subordinate)+ the complaint goes away. I'd like to understand why.
2009 Jul 01
2
Difficulty in calculating MLE through NLM
Hi R-friends, Attached is the SAS XPORT file that I have imported into R using following code library(foreign) mydata<-read.xport("C:\\ctf.xpt") print(mydata) I am trying to maximize logL in order to find Maximum Likelihood Estimate (MLE) of 5 parameters (alpha1, beta1, alpha2, beta2, p) using NLM function in R as follows. # Defining Log likelihood - In the function it is noted as
2008 Jan 04
2
R2WinBUGS sending variables as factors
Hello R and BUGS users, I am writing a heirarchical model in R to send to BUGS via R2WinBUGS and I am finding it difficult to get the model to run. I seem to be having two problems. 1) I can't seem to send variables classed as factors (Month), is there a way do this? 2) Checking the Log in WinBUGS I can see that the model is Syntactically correct, but Bugs is not able to recognise the the
2011 Sep 16
2
v2.1.alpha2 released
http://dovecot.org/releases/2.1/alpha/dovecot-2.1.alpha2.tar.gz http://dovecot.org/releases/2.1/alpha/dovecot-2.1.alpha2.tar.gz.sig This is actually looking rather stable. I'm still calling it "alpha" in case I think of doing some more API changes, but I think the next one will be called "beta1", hopefully soon followed by "rc1". - Statistics gathering
2011 Sep 16
2
v2.1.alpha2 released
http://dovecot.org/releases/2.1/alpha/dovecot-2.1.alpha2.tar.gz http://dovecot.org/releases/2.1/alpha/dovecot-2.1.alpha2.tar.gz.sig This is actually looking rather stable. I'm still calling it "alpha" in case I think of doing some more API changes, but I think the next one will be called "beta1", hopefully soon followed by "rc1". - Statistics gathering
2005 Feb 27
2
Help with constrained optimization
Dear all, I need an advice in the following problem. I have to maximize two functions of the form f1(x)=f(y1,x,alpha1,beta1) and f2(x)=(y2,x,alpha2,beta2), the maximization is with respect to alpha1, alpha2, beta1, beta2. I can maximize each function separately using nlm. The problem is that I have to add the constraint of the form g(alpha1)=g(alpha2). The total number of parameters is
2005 Sep 14
2
SSL/TLS stopped working in 1.0 alpha2
I have both 1.0 alpha1 and alpha2 installed on my test mail server. SSL/TLS does not work on alpha2. I'm using the same config file for both. No errrors in dovecot.log either. Is there a way to increase debugging info without recompiling?
2011 Aug 11
1
R crashes when communicating with JAGS
There is a thread on this topic already: http://finzi.psych.upenn.edu/Rhelp10/2010-August/250934.html I'm rather mystified by a similar problem and wondering whether I've overlooked something obvious. I'm running with latest versions of R and all packages, and latest version of JAGS running under Windows 7. Here's the problem. I have some source code. It's given below -