similar to: Unflatten a table in R

Displaying 11 results from an estimated 11 matches similar to: "Unflatten a table in R"

2008 Dec 22
2
How can I avoid nested 'for' loops or quicken the process?
Hi All, I'm still pretty new to using R - and I was hoping I might be able to get some advice as to how to use 'apply' or a similar function instead of using nested for loops. Right now I have a script which uses nested for loops similar to this: i <- 1 for(a in Alpha) { for (b in Beta) { for (c in Gamma) { for (d in Delta) { for (e in Epsilon) { Output[i] <-
2004 Jan 19
2
Relative risk using GAM
I am a new user of R. I am trying to fit gam model with our air pollution data. I used Foreign package to call data from SPSS and used MGCV package to fit gam. The following are the steps I used: > dust<- read.spss("a:dust9600jan.sav") > c<-gam(MRESPALL~s(DUSTM)+s(TEMP)+s(RH),family=poisson,data=dust) > summary(c) Family: poisson Link function: log Formula: MRESPALL ~
2010 Apr 30
2
Flattening and unflattening symmetric matrices
Here's an easy question: I'd like to convert a symmetric matrix to a vector composed of the upper.tri() part of it plus the diagonal, and convert it back again. What's the best way to achieve this? I'm wondering if there are some built in functions to do this easily. I can encode fine: v <- c(diag(A),A[upper.tri(A)]) but I don't see an easy way to recover A from v
2006 Feb 03
2
Problems with ks.test
Hi everybody, while performing ks.test for a standard exponential distribution on samples of dimension 2500, generated everytime as new, i had this strange behaviour: >data<-rexp(2500,0.4) >ks.test(data,"pexp",0.4) One-sample Kolmogorov-Smirnov test data: data D = 0.0147, p-value = 0.6549 alternative hypothesis: two.sided >data<-rexp(2500,0.4)
2006 May 23
1
lattice package - question on plotting lines
Hi all, I was trying to plot a graph using the following data: method percent accuracy group A1 4 0.8529 cns A1 10 0.8412 cns A1 15 0.8235 cns A2 4 0.9353 cns A2 10 0.9412 cns A2 15 0.9471 cns A1 4 0.8323 col A1 10 0.8452 col A1 15 0.8484 col A2 4 0.8839 col A2 10 0.8677 col A2 15 0.8678 col ################# The code I'm using to generate the graphs is: ### code :
2006 Jan 18
1
Within-Subjects ANOVA & comparisons of individual means
I am having problems with comparing individual means in a within-subjects ANOVA. From my understanding, TukeyHSD is not appropriate in this context. So I am trying to compute contrasts, as follows: seven subjects participated in each of 6 conditions (intervals). > subject = factor(rep(c(1:7), each = 6)) > interval = factor(rep(c(1:6), 7)) and here is the dependent variable: > dv
2009 Sep 23
1
re peated measures
Hi, I am performing a repeated measures 2-way ANOVA to assess the influence of plant and leaf on aphid fecundity. Fecundity is measured for each aphid on a single leaf. Here is what I typed. wingless <- reshape(Wingless, varying =
2006 Jul 19
1
How would you export a 3-dimensional array to an SQL database?
Hello, How would you export a 3-dimensional array to an SQL database? a<-array(1:24, 2:4) Is there an open source DB that would be more adequate for this type of operation? Is there a way to reshape/flatten a 3-dimensional array? Regards, Pierre Lapointe ************************************************** AVIS DE NON-RESPONSABILITE: Ce document transmis par courrie...{{dropped}}
2006 Jan 22
0
Error in 1:object$rank : NA/NaN argument
can anybody help with the following error message: Error in 1:object$rank : NA/NaN argument I get it with comparisons of single means in an ANOVA. Example data below. Thanks, Steffen seven subjects participated in each of 6 conditions (intervals). > subject = factor(rep(c(1:7), each = 6)) > interval = factor(rep(c(1:6), 7)) and here is the dependent variable: > dv = c(3.3868,
2008 Jul 25
2
Fit a 3-Dimensional Line to Data Points
Hi Experts, I am new to R, and was wondering how to do 3D linear regression in R. In other words, I need to Fit a 3-Dimensional Line to Data Points (input). I googled before posting this, and found that it is possible in Matlab and other commercial packages. For example, see the Matlab link:
2012 Jul 06
4
differences between survival models between STATA and R
Dear Community, I have been using two types of survival programs to analyse a data set. The first one is an R function called aftreg. The second one an STATA function called streg. Both of them include the same analyisis with a weibull distribution. Yet, results are very different. Shouldn't the results be the same? Kind regards, J -- View this message in context: