similar to: Help writing basic loop

Displaying 20 results from an estimated 1000 matches similar to: "Help writing basic loop"

2005 Jun 08
2
Robustness of Segmented Regression Contributed by Muggeo
Hello, R users, I applied segmented regression method contributed by Muggeo and got different slope estimates depending on the initial break points. The results are listed below and I'd like to know what is a reasonable approach handling this kinds of problem. I think applying various initial break points is certainly not a efficient approach. Is there any other methods to deal with segmented
2011 Apr 13
1
print to .jpeg
Evening folks, I'm trying to print a series of graphs to .jpeg using a variable as the title, but run into the difficultly that I can't find a way to append the file extension to the .jpeg (in this case extensionless!) files. Example: ---- species.name="CussoniaHolstii" dia<-10:100 biomass = -21.4863 + 0.5797 * (dia ^ 2) biomass jpeg(species.name) plot (biomass,
2011 Jun 20
1
Quick R syntax question
Hi -- I had a pretty quick R question since unfortunately I have not been able to find an answer on Google. It shouldn't take much more than a minute to answer. I'm trying to add up the major gleason grade and minor gleason grade for an analysis of patients with prostate cancer. One column has values under "Major Gleason" and another column has values under "Minor
2010 Apr 08
2
Overfitting/Calibration plots (Statistics question)
This isn't a question about R, but I'm hoping someone will be willing to help. I've been looking at calibration plots in multiple regression (plotting observed response Y on the vertical axis versus predicted response [Y hat] on the horizontal axis). According to Frank Harrell's "Regression Modeling Strategies" book (pp. 61-63), when making such a plot on new data
2011 Dec 01
2
R endnote entry
I know citation() gives the R citation to be used in publications. Has anyone put this into endnote nicely? I'm not very experienced with endnote, and the way I have it at the momeny the 'R Development Core Team' becomes R. D. C. T. etc. Cheers.
2011 Sep 01
2
Help with creating date as POSIXct
Dear list, I want to create a POSIX time vector as follows: day <- as.character("110809") time.t <- 1:3600 t.min <- time.t %/% 60 t.sec <- time.t-t.min*60 DATE <- as.POSIXct(strptime(paste(day,t.min,t.sec),"%y%m%d %M%S")) Tail(DATE) The problem is that the last element (3600) returns a NA and I don't understand why. 600, 1200, 2400
2011 Mar 08
4
Make R 'Beep'
Dear all, I would like to ask you if R can produce any kind of sound. It would be useful when code execution stops R to notify me by playing some sound. Is that possible in R? I would like to thank you in advance for your help Best Regards Alex
2011 Sep 22
2
How to adjust the y-axis range in barplot properly
Hello R-Users, it might be a rather simple problem I have, but I couldn't find any solution online. Thus, here is my problem: I would like to adjust the y-axis range in a barplot, since all my values are >70. Therefore I would like to only visualize the y-axis from 60-100 (example 1). The problem is, the range of the y-axis is adjusted, but the barsize stays the same and vanishes from
2011 Apr 22
2
statistic Q
Dear, i am a student and I need help in comparing between different slopes and finding whther there is a significant difference between them? Thanks a lot [[alternative HTML version deleted]]
2010 Apr 01
2
Adding regression lines to each factor on a plot when using ANCOVA
Dear R users, i'm using a custom function to fit ancova models to a dataset. The data are divided into 12 groups, with one dependent variable and one covariate. When plotting the data, i'd like to add separate regression lines for each group (so, 12 lines, each with their respective individual slopes). My 'model1' uses the group*covariate interaction term, and so the coefficients
2009 Apr 08
2
Null-Hypothesis
Hello R users, I've used the following help two compare two regression line slopes. Wanted to test if they differ significantly: Hi, I've made a research about how to compare two regression line slopes (of y versus x for 2 groups, "group" being a factor ) using R. I knew the method based on the following statement : t = (b1 - b2) / sb1,b2 where b1 and b2 are the two slope
2011 Sep 08
2
help subsetting data based on date AND time
Dear R Community, I am new to R, and have a question that I suspect may be quite simple but is proving a formidable roadblock for me. I have a large data set that includes water-quality measurements collected over many 24-hour periods. The date and time of sample collection are in a combined Date/Time field in the format yyyy-mm-dd hh:mm:ss. I need to be able to subset the data for analysis of
2005 Jan 23
4
survreg: fitting different location parameters
Hi R-Help! My question: I have lifetime/failure data of machines with different stress levels and i think an weibull/extreme value distribution would fit this data. So I did: model1 <- survreg(Surv(lfailure)~stress,data=steel,dist="extreme") (where lfailure=log(failure)) Now I would like to do a likelihood ratio test to test the hypothesis H0: location parameters of the
2008 May 04
4
improvement of Ancova analysis
Dear Helpers, I just started working with R and I'm a bit overloaded with information. My data is from marsupials reindroduced in a area. I have weight(wt), hind foot lenghts(pes) as continues variables and origin and gender as categorial. condition is just the residuals i took from the model. > names(dat1) [1] "wt" "pes" "origin" "gender"
2005 Jan 20
1
Windows Front end-crash error
Dear List: First, many thanks to those who offered assistance while I constructed code for the simulation. I think I now have code that resolves most of the issues I encountered with memory. While the code works perfectly for smallish datasets with small sample sizes, it arouses a windows-based error with samples of 5,000 and 250 datasets. The error is a dialogue box with the following: "R
2012 Jan 17
2
Which date format to choose?
R offers a bewildering array of options when it comes to representing dates and times (e.g, as.Date, chron, strptime, zoo, etc). Can anybody recommend a document that compares the relative merit of each method? I'm not looking for help with any one method, but rather a guide that describes which method is best for a particular data analysis/plotting goal. Thanks, Jake [[alternative
2012 Mar 14
1
lme code help
Hi guys, Got a few days left and I need to model a random effect of species on the body mass (logM) and temperature (K) slopes. This is what i've done so far that works: model1<-lme(logSSP~logM + K,random=~1|species,data=data1) model2<-lme(logSSP~logM + K,random=~K|species,data=data1) model3<-lme(logSSP~logM + K,random=~logM|species,data=data1) The one I now want is:
2002 May 28
1
passing model objects to anova()
Hi, I'm fitting a glm to a dataset... > objects() [1] "pop.div.full" "speciation.data" ...and then performing model simplification to give a series of model objects all of which have a common suffix. > objects() [1] "pop.div.full" "pop.div.gp.f.b.hm" [3] "pop.div.gp.fb.hm"
2008 Jan 22
2
Help - linear regression
Hi, I am trying a linear regression model where the dependent variable is the size of the heart corrected for the patient's height and weight. This is labelled as LAVI. The independent variables are race (european or non-eurpoean), age, sex (male or female) of the patient and whether they have diabetes and high blood pressure. sample size 2000 patients selected from a community. when I
2010 Sep 29
1
Trying to avoid loop structure
Dear R-helpers, I'm trying to associate linear coefficients (intercept and slope) to tens of thousands of observations based on a table with benchmark values. #####Example - Value table and their corresponding coefficients (intercept and slope) coef = data.frame(cbind(st=c(1:5),b = runif(5,0.3,5),a = seq(0.5,5,1)))print(coef) #Example of observations to be computedobs = runif(20,1,5)print(obs)