[R] Running a batch file with an r script

2009-09-08 Thread Daniel Bradley
Hi! I have a need to do the ridiculous and run a batch file if certain conditions are met within an R script. is there a simple way to do so? or to run dos commands? Thanks! Daniel [[alternative HTML version deleted]] __ R-help@r-project.org

Re: [R] Fitting a linear model with a break point

2009-09-08 Thread Daniel Malter
[i]=summary(lm(y~(x>(i-1$r.squared tested.threshold[i]=i-1 } #inspect r-squareds print(data.frame(tested.threshold,r.squared)) #Should indicate the highest r-squared #at the appropriate threshold level HTH, Daniel - cunc

[R] Fitting a linear model with a break point

2009-09-08 Thread Daniel Brewer
any ideas? Also is there a way of including the threshold in the actual model, so that could be estimated too? Thanks Dan -- ** Daniel Brewer, Ph.D. Institute of Cancer Research Molecular Carcinogenesis Email: daniel.bre...@icr.ac

Re: [R] Truncating (not rounding) scientific value in R

2009-09-08 Thread Daniel Malter
x=0.01345778543577 signif(x,3) - cuncta stricte discussurus - -Ursprüngliche Nachricht- Von: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Im Auftrag von Gundala Viswanath Gesendet: Tuesday, September 08, 2

Re: [R] Function to Normalize Numerical Vector in R

2009-09-07 Thread Daniel Malter
If you are looking for a function to standardize a variable so that it has mean zero and unit variance: std=function(x){if(length(which(is.na(x)))==0) (x-mean(x))/sd(x) else (x-mean(x,na.rm=T))/sd(x,na.rm=T) } x=rnorm(100,3,5) mean(x) sd(x) x2=std(x) mean(x2) sd(x2) HTH, Daniel

Re: [R] Omnibus test for main effects in the faceofaninteraction containing the main effects.

2009-09-07 Thread Daniel Malter
del with interaction effects if not all direct effects are included. And in fact, I never see this done in analyses in my field (business/economics). Daniel - cuncta stricte discussurus - -Ursprüngliche Nachricht- Von: John

Re: [R] Omnibus test for main effects in the face of aninteraction containing the main effects.

2009-09-07 Thread Daniel Malter
hen compare 2 to 1, and 3 to 2. This tells you whether including more variables (hierarchically) makes your model better. HTH, Daniel On a different note, if lme fits with "restricted maximum likelihood," I think I remember that you cannot compare them. You have to fit them with &quo

Re: [R] linear mixed model question

2009-09-07 Thread Daniel Malter
The workers=as.factor(workers) codeline in my post dropped below my name. It should be in the code before the command line for the linear model. Daniel Malter wrote: > > Wen, to follow up on Thierry, your workers are nested in machines (since > each worker only works one machine).

Re: [R] linear mixed model question

2009-09-07 Thread Daniel Malter
are equal for both machines #the equivalent formulation used is: is the sum of the coefficients across machines equal to zero? library(car) linear.hypothesis(fm4,hypothesis.matrix=c(1,1,1,-1,-1,-1),rhs=c(0)) hope that helps, daniel workers=as.factor(workers) Wen Huang-3 wrote: > > Hello,

Re: [R] Nested Fixed Effects - basic questions

2009-09-06 Thread Daniel Malter
ation of nested effects in R (e.g. with the nlme and lme4 libraries). So go ahead and put in the effort. Daniel ps: on a more general note, the R-help list is to help with the implementation in R rather than statistical/econometric questions, especially if these problems are exte

Re: [R] Nested Fixed Effects - basic questions

2009-09-04 Thread Daniel Malter
that the approach to use OLS to model your data is fine if your error distribution (the distribution of e in the simulated data) is normal. Daniel - cuncta stricte discussurus - -Ursprüngliche Nachricht- Von: r-help-boun...@r-project.org [mai

Re: [R] how to explain the interaction terms regarding "treatmentcontrast" of lm model

2009-08-28 Thread Daniel Malter
asks the question how much does group=2 with sub=b stand out from the average in its group and in its sub. To clarify your confusion, you may want to write out the model formula. Daniel - cuncta stricte discussurus - -Ursprüngliche Nachricht

Re: [R] table, xyplot, names, & loops

2009-08-25 Thread Daniel Malter
and five cities. Age=rep(0:3,each=25) City=rep(0:4,20) e=rnorm(100) #Create a dependent variable Height=(Age-1)+(City-1)+(Age-1)*(City-1)+e #Box whisker plot of Height by Age category for each City bwplot(Height~factor(Age)|factor(City)) Daniel - cuncta stricte

Re: [R] how to correlate nominal variables?

2009-08-25 Thread Daniel Malter
I updated the previously posted function for Cramer's V so that it automatically prints Cramer's V, chi-square, the degrees of freedom, and the significance level of Cramer's V based on the chi-square value and the degrees of freedom with desired (user-supplied) levels of precision. An example is

Re: [R] Help on comparing two matrices

2009-08-24 Thread Daniel Nordlund
cb[[2]][rep(1:nrow(cb[[2]]), nrow(cb[[1]])), ] ) ##compare m.o with all x.o where rows and columns of x.o with tied totals are permuted## for(i in 1:nrow(rperm)){ for(j in 1:nrow(cperm)){ if(identical(m.o,x.o[rperm[i,],cperm[j,]])) { cat('TRUE','\n') break }

Re: [R] Combining matrices

2009-08-24 Thread Daniel Nordlund
> -Original Message- > From: Marc Schwartz [mailto:marc_schwa...@me.com] > Sent: Monday, August 24, 2009 9:57 AM > To: Daniel Nordlund > Cc: r help > Subject: Re: [R] Combining matrices > > > On Aug 24, 2009, at 11:46 AM, Marc Schwartz wrote: > > &

Re: [R] table function

2009-08-24 Thread Daniel Malter
;1&z<3000) sum(z>3000) It's unclear to me whether you want to summarize the other variables (x and y) for each of the categories of z. If you want to do that, use tapply (see ?tapply). Daniel - cuncta stricte discussurus -

[R] Combining matrices

2009-08-24 Thread Daniel Nordlund
ortant, they are given so as to illustrate how I want to combine the matrices. I.e., I am looking for a general way to combine the first row of x with each row of y, then the second row of x with y, Thanks, Dan Daniel Nordlund Bothell, WA USA Than

Re: [R] intra-class correlation? coherence among multiple ordinal responses

2009-08-22 Thread Daniel Malter
Thank you, William. Best, Daniel William Revelle wrote: > > At 6:15 PM -0400 8/21/09, Daniel Malter wrote: >>I have a quick statistical question and hoped somebody has a tip for me >>without me having to go to the local statistician on Monday. >> >>I assess 4 sta

[R] intra-class correlation? coherence among multiple ordinal responses

2009-08-21 Thread Daniel Malter
se an alternative procedure given that my responses are ordinal. I am grateful for your tips, Daniel --- "Who has visions should see a doctor," Helmut Schmidt, German Chancellor (1974-1982). __ R-help@r-proj

Re: [R] How to extract row values?

2009-08-20 Thread Daniel Malter
Assuming your data.frame has the name "data," you would extract arbitrary row n by data[n, ] Daniel - cuncta stricte discussurus - -Ursprüngliche Nachricht- Von: r-help-boun...@r-project.org [mailto:r-help-boun...@r-proje

Re: [R] How to deal with multicollinearity in mixed models (with lmer)?

2009-08-16 Thread Daniel Malter
ncorrelated with the Xs, which is unlikely due to the correlation of kidc and year). The nice thing about it is that the year fixed effects model is unbiased in your case and spares you from including polynomials for the year. HTH, Daniel ps: If you want to model survival, you may want to think abo

Re: [R] How to use R to perform prediction based on history data

2009-08-15 Thread Daniel Malter
given the vague description of your data. Best, Daniel - cuncta stricte discussurus - -Ursprüngliche Nachricht- Von: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Im Auftrag von Jack Su Gesendet: Friday, August 14, 2009

Re: [R] Assigning values based on a separate reference (lookup) table

2009-08-14 Thread Daniel Malter
index") ##Perform multiplication names(new.x2) new.x2$"1"=new.x2$"1"*new.x2$"value" ##Reshape new.x2 back to the initial wide format of the matrix new.x2=new.x2[,1:3] new.x=reshape(new.x2,idvar="index",ids=row.names(x),direction="wide",times=

Re: [R] Assigning values based on a separate reference (lookup) table

2009-08-14 Thread Daniel Malter
Once you have the long format of the dataset, you could just code a "bin" variable and merge with this bin variable instead. Piece o' cake, ain't it? Daniel - cuncta stricte discussurus - -Ursprüngliche Nachricht- V

Re: [R] Assigning values based on a separate reference (lookup) table

2009-08-14 Thread Daniel Malter
y="index") ##Perform multiplication names(new.x2) new.x2$"1"=new.x2$"1"*new.x2$"value" ##Reshape new.x2 back to the initial wide format of the matrix new.x2=new.x2[,1:3] new.x=reshape(new.x2,idvar="index",ids=row.names(x),direction="wide",

Re: [R] lm coefficients output confusing

2009-08-13 Thread Daniel Malter
any) is not linear. For a comparison of all groups against one another from an analysis of variance, I think there other methods, like the Bonferroni-Dunn test (as a post-hoc test). Best, Daniel - cuncta stricte discussurus - -Ursprüngliche

Re: [R] When using randomForest, what's the effect to "set.seed"?

2009-08-13 Thread Daniel Malter
draw one unlucky seed, but that indeed setting different seeds aims at assuring "better randomness," as you suggest. Best, Daniel Chang, C-Y. wrote: > > Greetings, > > When reading the random forest manual by Liaw, in the examples > "set.seed" is always

Re: [R] Proper / Improper scoring Rules

2009-08-12 Thread Daniel Malter
equality sign)! Rather choose something like y.good, y.better, y.best, or whatever you like as variable names. HTH, Daniel - cuncta stricte discussurus - -Ursprüngliche Nachricht- Von: r-help-boun...@r-project.org [mailto:r-help-boun...

Re: [R] what is the difference between the two logistic models?

2009-08-12 Thread Daniel Malter
build models that you can understand and interpret. Daniel - cuncta stricte discussurus - -Ursprüngliche Nachricht- Von: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Im Auftrag von SNN Gesendet: Wednesday, August 12, 2009

Re: [R] logistic regression

2009-08-12 Thread Daniel Malter
variables as factors/dummies (or even factors coded as polynomial orthogonal contrasts), which is another reason to pick up a book on the topic. HTH, Daniel - cuncta stricte discussurus - -Ursprüngliche Nachricht- Von: r-help-boun...@r-projec

Re: [R] to extract a section of the matrix

2009-08-12 Thread Daniel Malter
x=c("blah","blub","bleep","foo") y=rnorm(4) yourdata=data.frame(x,y) yourdata newdata=yourdata[order(y),] newdata thisiswhatyouwant=newdata[1:2,] thisiswhatyouwant hth, daniel - cuncta stricte discussurus ---

Re: [R] nominal to numeric function

2009-08-12 Thread Daniel Malter
foo <- c("blue", "red", "green") foo=as.factor(foo) foo=as.numeric(as.character(foo)) foo #the numeric ordering is alphabetic hth, daniel - cuncta stricte discussurus - -Ursprüngliche Nachricht- Von: r-hel

Re: [R] nominal to numeric function

2009-08-12 Thread Daniel Malter
Hi you can use newvariable=as.numeric(variablename). This converts your factors into numeric variables, but not always with the desired result. So make sure that you check whether "newvariable" gives you what you want. Otherwise recoding by hand is indicated. Best, Daniel Noah S

Re: [R] problem adding columns to matrix

2009-08-09 Thread Daniel Nordlund
ed using just those 3 numbers (the first 3 numbers in the first column of your matrix) and recycled them as needed to fill out the matrix. You probably should have create the data frame directly, something like df <- data.frame(rbind(a,b,d,e)) As for question 2, I don't know why you got the

Re: [R] Seeing negative numbers to zero

2009-08-07 Thread Daniel Nordlund
> -Original Message- > From: r-help-boun...@r-project.org > [mailto:r-help-boun...@r-project.org] On Behalf Of Daniel Nordlund > Sent: Friday, August 07, 2009 2:50 PM > To: r-help@r-project.org > Subject: Re: [R] Seeing negative numbers to zero > > > -Ori

Re: [R] Seeing negative numbers to zero

2009-08-07 Thread Daniel Nordlund
you say it doesn't work, what does that mean? Do you get an error message? Are you left with negative numbers? What? A minimal, self-contained, reproducible example would help us help you. > KN1 <- rnorm(100) > KN2 <- ifelse(KN1 < 0, 0, KN1) Works fine for fine for me. D

Re: [R] Why is 0 not an integer?

2009-08-06 Thread Gerlanc, Daniel
vector it gets coerced to the more general type, in this case, numeric. Note that "is.numeric" returns TRUE for both is.numeric(0) and is.numeric(0L). Daniel Gerlanc Associate Analyst Geode Capital Management 1 Post Office Sq, Floor 28 Boston, MA 02109 daniel.gerl...@geodecapital.com ___

[R] Using system fonts in MacOS

2009-08-06 Thread Daniel J Farrell
't the quartz(family="Times-Roman") make the fonts change? (2) Is it possible to use any MacOS system fonts with R and the Quartz device window? Best regards, Daniel Farrell __ R-help@r-project.org mailing list https://stat.ethz.ch/mai

Re: [R] for loop

2009-08-05 Thread Daniel Malter
wever, without a self-contained example, it is impossible for us to know whether the error lies here or in one of the many other reasons (e.g. on of the functions called in your MODELS function). Daniel - cuncta stricte discussurus - -Ursprüng

Re: [R] for loop

2009-08-05 Thread Daniel Malter
and I may quote David Winsemius at this point: "In general this falls into the category of a request to "read my mind". Daniel - cuncta stricte discussurus - -Ursprüngliche Nachricht- Von: r-help-boun...@r-project.org [mai

Re: [R] for loop

2009-08-05 Thread Daniel Malter
e posting guide. And no worries, I have asked questions like yours before. It just takes some willingness and effort to learn to ask better questions in order to get helpful answers. Daniel - cuncta stricte discussurus - -Ursprüngliche Nachricht

Re: [R] for loop

2009-08-05 Thread Daniel Malter
Either you use for (k%in%col) or for (k in min(col):max(col)) does that work for you? Daniel - cuncta stricte discussurus - -Ursprüngliche Nachricht- Von: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Im Auftrag

Re: [R] polygon centroids

2009-08-05 Thread Daniel Malter
Not knowing the package or the function. Could the round() function help you? Or do you mean decimals shown in a plot? Best, Daniel - cuncta stricte discussurus - -Ursprüngliche Nachricht- Von: r-help-boun...@r-project.org [mailto:r-help

Re: [R] "na.strings" and the like; suspending interpretation of "NA"

2009-08-03 Thread Daniel Nordlund
ot;D" "E" NA > is.na(s2) [1] FALSE FALSE FALSE FALSE FALSE TRUE > Notice that in string s, the characters (NA) are surrounded by quotes, and R returns false for is.na(). But for string s2, the missing value NA is not surrounded by quotes and is.na() returns TRUE for s2[6

[R] Last expression entered by user

2009-08-02 Thread Daniel Haase
[1] 19 # but I am looking for the unevaluated expression (".Last.expression", so to say), which would be expression(x * x + 3) in this case Daniel __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read th

[R] Variable alias

2009-08-01 Thread Daniel Haase
Hi Everyone, is there the possibility in R to assign a variable to be an alias of another one? Example: x <- 17 # assign y to be an alias of x y # returns 17 x <- 4 y # returns 4 Daniel __ R-help@r-project.org mailing list https://stat.e

Re: [R] - counting factor occurrences within a group: tapply()

2009-07-29 Thread Daniel Malter
does "length" instead of "nlevels" do what you want to do? with(Trees,tapply(SppID,PlotID,unique)) daniel - cuncta stricte discussurus - -Ursprüngliche Nachricht- Von: r-help-boun...@r-project.org [mailto:r-help-b

Re: [R] Nonlinear mixed binary regression model

2009-07-28 Thread Daniel Malter
Caio, check the lme4 library. The lmer function allows for fixed and random effects. Daniel - cuncta stricte discussurus - -Ursprüngliche Nachricht- Von: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Im Auftrag von

Re: [R] Help with significance. T-test?

2009-07-28 Thread Daniel Malter
Look up the McNemar test. That sounds right... Daniel - cuncta stricte discussurus - -Ursprüngliche Nachricht- Von: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Im Auftrag von mik07 Gesendet: Tuesday, July 28, 2009

Re: [R] how to correlate nominal variables?

2009-07-27 Thread Daniel Malter
)))-1))) } } } Daniel Malter wrote: > > You can copy the code below to your R-code editor. For Yule's Q, the data > is expected in two vectors. For cramer's phi, the data is expected in > separate columns of a matrix or dataframe. > > ##Run this code > yule.Q=function(x,y){(table

Re: [R] Assessing standard errors of polynomial contrasts

2009-07-25 Thread Daniel Malter
I should have mentioned that I am using the lmer library for my analyses, just in case other methods provide results differently. Daniel - cuncta stricte discussurus - -Ursprüngliche Nachricht- Von: r-help-boun...@r-project.org [mailto:r

[R] Assessing standard errors of polynomial contrasts

2009-07-25 Thread Daniel Malter
rather than an R question, but I thought one of the many specialists in experiments might be able to help me out quickly on this or point me to appropriate literature. Thanks, Daniel --- "Who has visions should see a doctor," Helmut Schmi

Re: [R] ROCR package question

2009-07-25 Thread Daniel Nordlund
? > x<-c(rnorm(100), 30); > boxplot(x) > boxplot(x,outline=FALSE) Dan Daniel Nordlund Bothell, WA USA __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.

Re: [R] How to test frequency independence (in a 2 by 2 table) withmany missing values

2009-07-24 Thread Daniel Malter
al variation among the subject (in other words, respecting that some are just more likely than others to answer yes). But Robert has pointed out many valuable alternative approaches. Best, Daniel - cuncta stricte discussurus - _ V

Re: [R] How to test frequency independence (in a 2 by 2 table) withmany missing values

2009-07-24 Thread Daniel Malter
ns par(mfcol=c(1,2)) hist(estim[,1],main="Intercept") hist(estim[,2],main="Effect of variable 'test'") HTH, Daniel - cuncta stricte discussurus - -Ursprüngliche Nachricht- Von: r-help-boun...@r-project.org [m

Re: [R] CI wiskers

2009-07-24 Thread Daniel Malter
Here it is... http://www.nabble.com/plotting-confidence-intervals-td24482119.html Marc's answer is probably the way to go Daniel - cuncta stricte discussurus - -Ursprüngliche Nachricht- Von: Daniel Malter [mailto:dan...@um

Re: [R] CI wiskers

2009-07-24 Thread Daniel Malter
I recently answered this (or, rather, basically the same) question in a thread with an example in it. I am trying to find it back. Just a sec - cuncta stricte discussurus - -Ursprüngliche Nachricht- Von: r-help-boun...@r-project.org [mailto

Re: [R] Sum with Conditions

2009-07-23 Thread Daniel Malter
vents variable given your conditions does that work for you? Daniel - cuncta stricte discussurus - -Ursprüngliche Nachricht- Von: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Im Auftrag von jimdare Gesendet: Thursday, J

Re: [R] How to perform a calculation in each element of my list?

2009-07-23 Thread Daniel Malter
x4) listdata=list(data1,data2) for(i in 1:length(listdata)){ listdata[[i]][,length(listdata[[i]])+1]=listdata[[i]][,length(listdata[[i]]) ]*listdata[[i]][,length(listdata[[i]])-1] } HTH, Daniel - cuncta stricte discussurus - -Ursprüngliche N

[R] exactly overlaid semi-transparent lines

2009-07-23 Thread Daniel Farewell
is multiple imputation, plotting n imputations at alpha = 1/n to see where there is, or is not, variability.) Many thanks, Daniel Farewell Cardiff University R version 2.9.1 (2009-06-26) i386-apple-darwin8.11.1 locale: en_GB.UTF-8/en_GB.UTF-8/C/C/en_GB.UTF-8/en_GB.UTF-8 attached base package

Re: [R] How do I delete a row from a data frame when varA == "TRUE"

2009-07-21 Thread Daniel Malter
XYZ=XYZ[XYZ$A==TRUE , ] should do. Note that this specific command overwrites your XYZ dataframe. If you want to keep XYZ, you will want to name the newly created frame differently. HTH, Daniel - cuncta stricte discussurus - -Ursprüngliche

Re: [R] Re gression for loop test HELP! URGENT!

2009-07-20 Thread Daniel Malter
prediction. Best, Daniel - cuncta stricte discussurus - -Ursprüngliche Nachricht- Von: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Im Auftrag von Rbeginner Gesendet: Monday, July 20, 2009 10:50 PM An: r-help@r

Re: [R] Re gression for loop test HELP! URGENT!

2009-07-19 Thread Daniel Malter
asets... Daniel - cuncta stricte discussurus - -Ursprüngliche Nachricht- Von: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Im Auftrag von Rbeginner Gesendet: Sunday, July 19, 2009 9:49 PM An: r-help@r-project.org Betreff: [

Re: [R] ifelse choices in a data.frame?

2009-07-19 Thread Daniel Nordlund
F$d) * DF$Test + (DF$c+DF$d) * !DF$Test > > DF$f = with(DF, (c*d)*Test + (c+d)*!Test) > > DF Mark, Why can't you use ifelse() ? DF$g <- with(DF, ifelse(Test,c*d,c+d)) Have I missed something in what you are doing? Dan Daniel Nordlund Bothell, WA USA __

Re: [R] Package norm has been removed. What to use for Maximum Likelihood Missing Data Imputation?

2009-07-17 Thread Daniel Abbott
I appreciate the info! I am mostly interested with ML missing data imputation. Is there another R module which has such a function that is well regarded? Thank you. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEAS

[R] Package norm has been removed. What to use for Maximum Likelihood Missing Data Imputation?

2009-07-17 Thread Daniel Abbott
Hello, I apologize if an answer to my questions is available, or if I submitted this question incorrectly. I have read the mailing lists, as well as the R Project and CRAN homepages. However, I may have missed something. I noticed the package 'norm' has been removed. Its page http://cran.r-projec

Re: [R] Nested ANOVA residuals error

2009-07-16 Thread Daniel Malter
It is because the nesting structure perfectly explains the data (i.e., there is only one observation and, therefore, no variation for each Ind in each Treatment). e=rnorm(90,0,1) x=rep(1:3,30) y=rep(1:30,each=3) z=x+y+e ano=aov(z~factor(y)/factor(x)) ano residuals(ano) Best, Daniel

Re: [R] Bug in package.skeleton, R 2.9.0?

2009-07-15 Thread Daniel Klevebring
Bump Anyone? Thanks Daniel On 13 jul 2009, at 10.57, Daniel Klevebring wrote: > Dear all, > > I am using package.skeleton to build a small packages of misc function > for personal use. I have recently discovered that the option > force=TRUE doesn't seem to do what is mean

Re: [R] plotting confidence intervals

2009-07-14 Thread Daniel Malter
example should be fine. Daniel - cuncta stricte discussurus - -Ursprüngliche Nachricht- Von: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Im Auftrag von Erin Hodgess Gesendet: Tuesday, July 14, 2009 11:40 AM An: R help

Re: [R] plotting confidence intervals

2009-07-14 Thread Daniel Malter
y #pch=16 puts a filled dot #lcolor=NA removes the dotted lines on the chart #now plot the confidence intervals for(i in 1:max(CI$index)){ lines(c(CI$lower[i],CI$upper[i]),c(i,i)) } #for each index (i.e., estimated coefficient) #plot x-coordinates CI$upper and CI$lower #at y-coordinate = in

Re: [R] Nested for loops

2009-07-13 Thread Daniel Nordlund
ed in the ABOVE diagonal elements (i.e. not including diagonal element temselves), the your loop should be for (i in 1:9) { for (j in (i+1):10) { // do something } } And you avoid your current problem. Hope this is helpful, Dan Daniel Nordlund Bothell, WA USA __

[R] Bug in package.skeleton, R 2.9.0?

2009-07-13 Thread Daniel Klevebring
folder or the dk folder altogether, the changes come along so to me it seems that it's the overwrite part that doesn't work as it should - or am I doing something wrong here? To me, it seems that the function safe.dir.create (which is defined in package.skeleton never overwrit

Re: [R] 'scan' in a script?

2009-07-09 Thread Daniel Nordlund
do that until I learn what I'm doing wrong. > > I've got more interesting questions of which the answers are far more > important to me than this one! > > Thanks, > Mark Mark, Take a look at the readline() function. Hope this is helpful, Dan Daniel Nordlund Bothell,

Re: [R] T.test error help

2009-07-09 Thread Daniel Malter
put another condition in your loop if(all.equal(x,y)=TRUE) i=i+1 else t.test... something in that direction. best, daniel - cuncta stricte discussurus - -Ursprüngliche Nachricht- Von: r-help-boun...@r-project.org [mailto:r-help-boun

Re: [R] Population pyramids

2009-07-09 Thread Daniel Malter
TRUE, density = NULL, angle = 0, col = c("yellow","Blue","orange"), border = par("fg"), main = "Mujeres", xlim =NULL, ylim = NULL, xpd = TRUE, log = "", axisnames = FALSE, axis(1,cex.axis=0.75)) That s

[R] Bug in package.skeleton, R 2.9.0?

2009-07-09 Thread Daniel Klevebring
folder or the dk folder altogether, the changes come along so to me it seems that it's the overwrite part that doesn't work as it should - or am I doing something wrong here? See below for sessionInfo. Thanks a bunch Daniel > sessionInfo() R version 2.9.0 (2009-04-17) i

Re: [R] Population pyramids

2009-07-08 Thread Daniel Malter
Can you provide a self-contained example of what you did so far (i.e. code for simulating some data and code for the plot)? That would greatly help to help you find a solution. Daniel - cuncta stricte discussurus - -Ursprüngliche Nachricht

Re: [R] Population pyramids

2009-07-08 Thread Daniel Malter
have you tried the pyramid function in the epicalc package? best, daniel - cuncta stricte discussurus - -Ursprüngliche Nachricht- Von: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Im Auftrag von Victor Manuel Garcia

Re: [R] Best way to export values from a function?

2009-07-08 Thread Daniel Nordlund
return a list of the values multipleoutput<-function(x) { squared<-x^2 cubed<-x^3 exponential<-exp(x) factorialVal<-factorial(x) return(list(squared=squared, cubed=cubed, exponential=exponential, factorialVal=factorialVal)) } Hope this is he

Re: [R] R: R: Is there a way to extract some fields data from HTML pages through any R function ?

2009-07-06 Thread Daniel Nordlund
the read.xls() function from the gdata package to get the file, something like this library(gdata) df <- read.xls("http://mirecords.umn.edu/miRecords/download_data.php?v=1";) Hope this is helpful, Dan Daniel Nordlund Bothell, WA USA __

Re: [R] 'singularity' between fixed effect and random factor in mixedmodel

2009-07-01 Thread Daniel Malter
An Econometrician may help you with more theoretical insights, but you could do Monte-Carlo simulations of data and analyze the effects you are interested in. Daniel - cuncta stricte discussurus - -Ursprüngliche Nachricht- Von: r-help-boun

Re: [R] newbie - read.csv creates a (data.frame, table, array, matrix, ...) and plotting one column

2009-06-28 Thread Daniel Nordlund
26.00 10,274.00 10,326.00 10,390.00 10,570.00 > >> 10,638.00 10,728.00 10,952.00 9,854.00 > >>> > >> > >> Now, here's the confusion. plot(T1[,1],T1[,10]) creates a plot, but > >> the range on both X & Y is 1-10. I want 1-10 on the X axis but ne

Re: [R] HLM - centering level 2 predictor

2009-06-28 Thread Daniel Malter
tween x1 and x2, and with a level 1 random effect (intercept) only? That would give a hint where the singularity arises. Best, Daniel - cuncta stricte discussurus - -Ursprüngliche Nachricht- Von: r-help-boun...@r-project.org [mailto:r-help

Re: [R] lmList

2009-06-24 Thread Daniel Malter
identical. If they are, the results should be the same. Daniel - cuncta stricte discussurus - -Ursprüngliche Nachricht- Von: Cecilia Carmo [mailto:cecilia.ca...@ua.pt] Gesendet: Wednesday, June 24, 2009 1:17 PM An: Daniel Malter Betreff: Re: AW

Re: [R] lmList

2009-06-24 Thread Daniel Malter
~x,subset=year%in%c(1),data=newdata). If you still observe differences, you have to be more specific and provide your data and code... Hope that helps, Daniel - cuncta stricte discussurus - -Ursprüngliche Nachricht- Von: r-help-boun...@r

[R] order by decerasing 1st variable and increasing 2nd variable

2009-06-24 Thread Daniel Brewer
it doesn't. Thanks Dan -- ****** Daniel Brewer, Ph.D. Institute of Cancer Research Molecular Carcinogenesis Email: daniel.bre...@icr.ac.uk ** The Institute of Cancer

[R] Found the stable 64bit OS X leopard builds

2009-06-24 Thread Daniel Brewer
Hi, I have found the stable 64bit OS X leopard builds here: http://r.research.att.com/ Dan -- ** Daniel Brewer, Ph.D. Institute of Cancer Research Molecular Carcinogenesis Email: daniel.bre...@icr.ac.uk

[R] CRAN: 64 bit OS X Leopard build

2009-06-24 Thread Daniel Brewer
Hello, I am after a stable 64 bit binary of R for OS X Leopard (i.e. 2.8). There seems to be the siggestion that thery should be available from CRAN: "leopardBinaries of universal (32-bit and 64-bit) package builds for Mac OS X 10.5 or higher" But when I follow the link there is only a co

Re: [R] ask for help xyplot

2009-06-23 Thread Daniel Malter
der in MEAN2 and SD2 LAC2=rep(1:5,each=4) DIM2=rep(1:4,5) #plot #may require to install package Hmisc library(Hmisc) Dotplot(LAC2~Cbind(MEAN2,INT.minus,INT.plus)|DIM2,method="bars") hth Daniel - cuncta stricte discussurus - -Ursprüngli

Re: [R] Problem with ifelse statement

2009-06-23 Thread Daniel Malter
s: data$SOCIAL_STATUS<-ifelse(data$SOCIAL_STATUS=="B" & data$MALE>4, "C", data$SOCIAL_STATUS) Right? Daniel - cuncta stricte discussurus - -Ursprüngliche Nachricht- Von: r-help-boun...@r-project.org [mailto:r-help-bo

Re: [R] first value...

2009-06-23 Thread Daniel Malter
min(which(is.na(inc)==FALSE)) #index inc[min(which(is.na(inc)==FALSE))] #value hth daniel - cuncta stricte discussurus - -Ursprüngliche Nachricht- Von: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Im Auftrag von

Re: [R] nested cross-sectional design using lmer or nlme

2009-06-23 Thread Daniel Malter
question which random effects to select is a modeling question and thus ultimately the ressearchers responsibility. Best, Daniel - cuncta stricte discussurus - -Ursprüngliche Nachricht- Von: r-help-boun...@r-project.org [mailto:r-help-boun

Re: [R] correlation between categorical data

2009-06-21 Thread Daniel Malter
function(x,y){(table(x,y)[1,1]*table(x,y)[2,2]-table(x,y)[1,2]*table( x,y)[2,1])/(table(x,y)[1,1]*table(x,y)[2,2]+table(x,y)[1,2]*table(x,y)[2,1]) } yule.Q(ycat,xcat) Best, Daniel - cuncta stricte discussurus - -Ursprüngliche Nachricht- V

Re: [R] ifelse(is.na), with function inside

2009-06-17 Thread Daniel Nordlund
- it's superb! but I need call a function: wy[i]<- > ifelse(((is.na(a))), call_fun1(x), call_fun2(x) > > > Not sure if I understand everything you want to do, but what is wrong with just using wy <- ifelse(is.na(a), fun1(x), fun2(x)) Hope this

Re: [R] Running stats on individual data.frames from the split()function list

2009-06-16 Thread Daniel Malter
for each day tapply(y,day,mean) ##shows mean of y for each day ##should be about equal to two times the day index no. tapply(y,day,sd) ##show sd of y for each day ##should be about equal to the day index no. Best, Daniel - cuncta stricte discussurus

Re: [R] save the output of summary(lmList(x)) into a dataframe

2009-06-16 Thread Daniel Malter
[2,1,2] #slope 2 summary(reg)$coef[3,1,2] #slope 3 summary(reg)$coef[1,2,1] #SE intercept 1 summary(reg)$coef[2,2,1] #SE intercept 2 summary(reg)$coef[3,2,1] #SE intercept 3 summary(reg)$coef[1,2,2] #SE slope 1 summary(reg)$coef[1,2,2] #SE slope 2 summary(reg)$coef[1,2,2] #SE slope 3 #etc. Best

[R] (sem assunto)

2009-06-10 Thread Daniel Mail
hello, i was trying to predict values for a garch, so i did: predict(fitgarch,n.ahead = 20) but this doesn't work. Someone can tell me how to get the 20 values ahead of a garch model. thanks in advance _ Obtenh

[R] Predict GARCH

2009-06-10 Thread Daniel Mail
hello, i was trying to predict values for a garch, so i did: predict(fitgarch,n.ahead = 20) but this doesn't work. Someone can tell me how to get the 20 values ahead of a garch model. thanks in advance _ O Windows

[R] Import ARIMA coefficients

2009-06-04 Thread Daniel Mail
Hello, I need to know how to import ARIMA coefficients. I already determined the coefficients of the model with other software, but now i need to do the forecast in R. For Example: I have a time series named x and i have fitted an ARIMA(1,0,1) (with other software) AR coef = -.17

<    4   5   6   7   8   9   10   11   12   13   >