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] 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] 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] 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 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] 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] 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] 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] 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] 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] 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] 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] 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

[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] 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] 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] How not to keep the redundant space when convert a data frame with as.matrix()?

2009-09-16 Thread Daniel Nordlund
gt; [8,] " 8" "r" > [9,] " 9" "s" > [10,] "10" "t" > You have asked several questions about using as.matrix() on a data.frame with colums of different types, in particular character and numeric types. Since matrices can o

Re: [R] statistics

2009-09-20 Thread Daniel Malter
This is not a "please solve my homework for me" newsgroup. Hint: You may want to learn about chi-square tests. Daniel - cuncta stricte discussurus - -Ursprüngliche Nachricht- Von: r-help-boun...@r-project.org [mailto:r-help

Re: [R] statistics

2009-09-20 Thread Daniel Malter
ebody else do my work for me, please. I don't know if there is any newsgroup that finds this approach acceptable. Daniel - cuncta stricte discussurus - -Ursprüngliche Nachricht- Von: r-help-boun...@r-project.org [mailto:r-help-boun...

Re: [R] how to count occurrences of string?

2009-09-20 Thread Daniel Malter
ooking.for,string) ##Return a boolean for each index ##whether "lorem ipsum" is found or not? index%in%grep(i.am.looking.for,string) ##Finally, table the occurrence/absence of ##"lorem ipsum" by gender table(index%in%grep(i.am.looking.for,stri

Re: [R] How to combine matrices?

2009-09-22 Thread Daniel Malter
is rbind(a,b,c) what you mean? Daniel - cuncta stricte discussurus - -Ursprüngliche Nachricht- Von: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Im Auftrag von FMH Gesendet: Tuesday, September 22, 2009 12:40 PM An: r

Re: [R] How to sort the elements in a matrix?

2009-09-22 Thread Daniel Malter
ab[order(ab[,1]),] - cuncta stricte discussurus - -Ursprüngliche Nachricht- Von: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] Im Auftrag von FMH Gesendet: Tuesday, September 22, 2009 1:20 PM An: r-help@r-project.org B

Re: [R] Problem with retreaving numeric data

2010-02-11 Thread Daniel Malter
My guess is that you cannot keep it numeric, but that you have to convert it to a string (the gurus may know better). x=001 x x="001" x Daniel - cuncta stricte discussurus - -Original Message- From: r-help-boun...@r-project.org

Re: [R] Question about rank() function

2010-02-11 Thread Daniel Malter
below: x=c(1.0001,1.0002,1.0003,1.0004,2.0001,2.0002,2.0003,3.0001,3.0002,4) rank(x) rank(round(x,2)) rank(x)==rank(round(x,2)) HTH, Daniel - cuncta stricte discussurus - -Original Message- From: r-help-boun...@r-project.org [mailto:r-help

[R] SAS and RODBC

2010-02-11 Thread Daniel Nordlund
ing down the problem? I don't know much about ODBC in general or what RODBC is doing under the hood, or how the SAS ODBC driver is written, but it would be useful if I could get R to write SAS datasets, and not just read them. Thanks, Dan Daniel Nordlund Bothell, WA USA __

[R] ff package: How to save and open ff(df) files.

2010-02-11 Thread daniel castro
this question and please apologize if my english is not very accurate and/or the question is too simple. Regards Daniel. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help P

Re: [R] for loop function output

2010-02-11 Thread Daniel Malter
ere j is in 1 to 5 and indicates the five values you want to store. HTH, Daniel - cuncta stricte discussurus - -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of seydahmet ercan Sent: F

Re: [R] SAS and RODBC

2010-02-12 Thread Daniel Nordlund
> -Original Message- > From: Prof Brian Ripley [mailto:rip...@stats.ox.ac.uk] > Sent: Thursday, February 11, 2010 1:25 AM > To: Daniel Nordlund > Cc: r-help@r-project.org > Subject: Re: [R] SAS and RODBC > > On Thu, 11 Feb 2010, Daniel Nordlund wrote: > >

Re: [R] lm function in R

2010-02-12 Thread Daniel Nordlund
64 > >> yHat[5]:68.67 > >> > >> This is based on the following equation (given in the PDF): Y = 1.67 + > X1 > >> + > >> 9.50 X2 > >> > >> I ran the following commands in R: > >> > >> data =

Re: [R] lm function in R

2010-02-13 Thread Daniel Malter
individual variables (x), columns with their interactions, and one column of 1s for the intercept. Let y be your dependent variable. Then, OLS estimates are computed by X'X inverse X'y Or in R solve(t(X)%*%X)%*%t(X)%*%y Best, Daniel - cuncta stricte d

Re: [R] SAS and RODBC

2010-02-13 Thread Daniel Nordlund
> -Original Message- > From: Frank E Harrell Jr [mailto:f.harr...@vanderbilt.edu] > Sent: Saturday, February 13, 2010 5:49 AM > To: Daniel Nordlund > Cc: r-help@r-project.org > Subject: Re: [R] SAS and RODBC > > Daniel Nordlund wrote: > . . . > > > &

[R] sas.get and Windows: WAS RE: SAS and RODBC

2010-02-14 Thread Daniel Nordlund
> -Original Message- > From: Uwe Ligges [mailto:lig...@statistik.tu-dortmund.de] > Sent: Sunday, February 14, 2010 7:09 AM > To: Daniel Nordlund > Cc: r-help@r-project.org > Subject: Re: [R] SAS and RODBC > > > > On 14.02.2010 08:19, Daniel Nordlund wro

Re: [R] Bivariate Uniform distribution

2010-02-16 Thread Daniel Nordlund
er advice can be given. A bivariate uniform distribution is simply pairs of uniform random numbers. The density is constant, so it is easy to get to the other quantities that you want based on that. So what is it that you are actually wanting to do? Dan Daniel Nordlund Bothell, WA USA ___

Re: [R] Survival analysis

2010-02-17 Thread Daniel Malter
significant, it will tell you that something about obs for which your data is missing is different than for the year for which you have observed the independent variables. But that requires us to figure out which model to use in the first place. Best, Daniel - cuncta

Re: [R] Survival analysis

2010-02-17 Thread Daniel Malter
lieve some of these concerns as it would capture unobserved heterogeneity between observed and unobserved time periods. Daniel - cuncta stricte discussurus - -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-p

Re: [R] Solve equation using R

2010-02-17 Thread Daniel Malter
Exact to the degree that real numbers can be exactly expressed. Look into ?uniroot You want to specify the function in a one-sided way, i.e., x/(1-exp(-x))-2.2 HTH, Daniel - cuncta stricte discussurus - -Original Message- From: r-help

Re: [R] inverse lexicographical ordering

2010-02-19 Thread Daniel Malter
,z),] HTH, Daniel - cuncta stricte discussurus - -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Evgenia Sent: Friday, February 19, 2010 12:10 PM To: r-help@r-project.org Subject: [R

[R] Siegel-Tukey test for equal variability (code)

2010-02-22 Thread Daniel Malter
variability rather than ascending order. This is essentially what the code further below does. After the rank transformation, a regular Mann-Whitney U test is applied. The "manual" and code are pasted below. Best, Daniel Siegel-Tukey test Description: Non-parametric Siegel-Tukey test for e

Re: [R] How to add a variable to a dataframe whose values are conditional upon the values of an existing variable

2010-02-26 Thread Daniel Malter
ifelse approach DOW.ind=ifelse(DOW=="MON",1,ifelse(DOW=="TUE",2,0)) #continue to nest ifelse statements for more days DOW.ind #merging approach day=c("MON","TUE") ind=c(1,2) ind.frame=data.frame(day,ind) merge(data.frame(DOW),ind.frame,by.x="DO

[R] Best Hardware & OS For Large Data Sets

2010-02-27 Thread J. Daniel
Greetings, I am acquiring a new computer in order to conduct data analysis. I currently have a 32-bit Vista OS with 3G of RAM and I consistently run into memory allocation problems. I will likely be required to run Windows 7 on the new system, but have flexibility as far as hardware goes. Can

[R] sem package and growth curves

2010-03-01 Thread Daniel Nordlund
ng to share? I would also be interested in other simple examples using sem and RAM specifications. If anyone is interested, I would also be willing to share the R code I have written for other chapters in the Singer and Willett book. Thanks, Dan Daniel Nordlund

Re: [R] sem package and growth curves

2010-03-03 Thread Daniel Nordlund
neral or had overlooked in the documentation for the sem package. Again, this has been very helpful, Dan Daniel Nordlund Bothell, WA USA > -Original Message- > From: John Fox [mailto:j...@mcmaster.ca] > Sent: Wednesday, March 03, 2010 7:19 AM > To: 'Chuck Cleland&#x

[R] A list of data.frames merged together

2010-03-09 Thread Daniel Brewer
1 5 ... 04/15/102 5 05/15/103 NA 06/15/10NA 5 Any ideas? I have been fiddling around with plyr and reshape without success Thanks Dan -- ** Daniel Brewer, Ph.D. Institute of C

[R] dmvnorm masked by emdbook

2010-03-13 Thread Daniel Murphy
I am using curve3d in the emdbook package to graph a gaussian copula density function generated via the copula package. Unfortunately, it appears that emdbook masks dmvnorm from the package mvtnorm in a way that prohibits copula from generating the gaussian copula. (Sounds very confusing!) For exam

Re: [R] How to select a row from one dataframe that is "close" to a row in another dataframe

2010-03-20 Thread Daniel Malter
provide unique identification, maybe Flight and OnDate together do, which can also be handled in merge. Let us know if that solves the problem. Best, Daniel - cuncta stricte discussurus - -Original Message- From: r-help-boun...@r

Re: [R] EM algorithm in R

2010-03-21 Thread Daniel Nordlund
be > equal to 1,2,3,4,5,6, corresponding to the component with lowest BIC > Caicno # so for this, I wish to obtain 300 values of k, where k can be > equal to 1,2,3,4,5,6, corresponding to the component with lowest CAIC > This is helpful, because we can now help you with R and

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] 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] '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] 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] 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] 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] 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

[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-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

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] '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,

[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] 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 __

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] 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] 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] 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

[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] 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

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] 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] 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] 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

[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 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

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] 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] 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] 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] 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] 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.

[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] 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

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] 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] 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] - 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

[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

[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

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

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] 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] 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
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
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] 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 ___

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] 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

[R] Bulk editing of mySQL tables

2010-03-24 Thread Daniel Brewer
Dan -- ** Daniel Brewer, Ph.D. Institute of Cancer Research Molecular Carcinogenesis Email: daniel.bre...@icr.ac.uk ** The Institute of Cancer Research: Royal Cancer Hospital, a charitable Company Limited by Guarantee, Regis

[R] Linear mixed models with custom link functions in R

2010-03-26 Thread Daniel Barton
nomial(logexp(days=expos))) ##Call to glm with custom link - Best, Dan Barton -- Daniel C. Barton PhD Candidate USGS Montana Cooperative Wildlife Research Unit & Program in Organismal Biology and Ecology University of Montana 205 Natural Science Missoula, MT 59812 daniel.ba

Re: [R] Coding of categorical variables for logistic regression?

2010-03-28 Thread Daniel Malter
umeric variable and its higher order polynomials (e.g., Rosenthal and Rosnow 1985). Daniel - cuncta stricte discussurus - -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of C.H. Sent: Sund

Re: [R] Matrix elements are vectors

2010-04-05 Thread Daniel Malter
mmy matrix in the first place; so the list is really the way to go. x1=c(1,2,3) x2=c(4,5,6) y1=c(0,1,2,3) y2=c(4,5,6,7) myList=list(x1,y1) myList myList[[1]]=append(myList[[1]],x2) myList[[2]]=append(myList[[2]],y2) myList HTH, Daniel - cuncta stricte d

Re: [R] SAS and R on multiple operating systems

2010-04-05 Thread Daniel Nordlund
DATA statement used (Total process time): > real time 0.04 seconds > cpu time0.01 seconds > > I can even concatenate windows and unix SAS datasets. > > Hope this helpful, Dan Daniel Nordlund Bothell, WA USA ___

[R] lattice package: line end style

2010-04-06 Thread Daniel Alcock
nce Dan P.S. the reason for this is that the round end looks bad at lwd=3 or more Daniel Alcock Malaria Genetics (T112) Wellcome Trust Sanger Institute Cambridge CB10 1SA UK +44 (0)1223 834244 ext. 4994 "The most exciting phrase to hear in science, the one that heralds new discoveries, i

<    1   2   3   4   5   6   7   8   9   10   >