Displaying 20 results from an estimated 61 matches for "ungroup".
Did you mean:
ingroup
2007 Oct 18
5
vector graphics/ ungroup and edit in CorelDraw
...shing in a journal that is very picky about their
graphics formats. It is more efficient for me to get the final picky
details of each graph done by our graphics department, who use Windows
CorelDraw. The problem is that I have not yet been able to give them a
vector graphics format that can be ungrouped in CorelDraw for editing.
Bitmaps cannot be ungrouped <www.eatbywest.com/pub/vectorbitmap/>. The
standard postscript that I am producing in R cannot be ungrouped either,
and comes into CorelDraw looking fragmented. While I may be doing
something odd in the production of my postscript fi...
2012 Jul 20
2
Changing ungrouped cases to grouped cases
...ay:
y A B C
0 1 1 2
0 1 2 1
1 1 1 2
0 1 1 2
1 1 1 2
1 1 2 1
0 1 2 2
.
.
.
And so on. How can I make my data look like the following:
y A B C
2 1 1 2
1 1 2 1
0 1 2 2
.
.
.
In other words how can I change my ungrouped cases into grouped cases?
Thanks!
Chris
[[alternative HTML version deleted]]
2003 Sep 25
3
ungrouping grouped data
...me (Galton's data on heights of parents and children),
in grouped form,
parent child frequency
73.5 72.2 1
73.5 73.2 3
72.5 68.2 1
72.5 69.2 2
72.5 70.2 1
72.5 71.2 2
72.5 72.2 7
72.5 73.2 2
72.5 74.2 4
71.5 65.2 1
71.5 66.2 3
71.5 67.2 4
71.5 68.2 3
71.5 69.2 5
71.5 70.2 10
...
and need the ungrouped equivalent, where each input observation
appears the number of times represented by its frequency. In SAS
this would be
data galton2;
set galton;
do i=1 to frequency;
output;
end;
I can replicate this in R, but surely there must be an easier way.
(In APL2 it would be frequen...
2003 Sep 25
0
AW: ungrouping grouped data
...n so something like this
XX <- data.frame(x=1:10,y=rbinom(10,3,0.5))
sapply(XX,rep,XX[,2])
HTH (if this do what you really want)
Thomas
-----Urspr?ngliche Nachricht-----
Von: Michael Friendly [mailto:friendly at yorku.ca]
Gesendet: Do 25.09.2003 19:14
An: r-help
Cc:
Betreff: [R] ungrouping grouped data
I'm sure this is probably simple, but I can't find an answer...
I have a data frame (Galton's data on heights of parents and children),
in grouped form,
parent child frequency
73.5 72.2 1
73.5 73.2 3
72.5 68.2 1
72.5 69.2 2
72.5 70.2 1
72.5 71.2 2
72.5...
2012 Jan 08
1
how to combine grouped data and ungrouped data in a trellis xyplot
I'm hoping the community knowledge can help me out here. I have found great
value in R, especially using it to generate charts, but I am still scaling
the learning curve in a number of ways.
I am looking plot one grouped line and one ungrouped line in a lattice plot.
I can plot one grouped line like this (the line's color in each panel
becomes dependent on the newpool value):
xyp<-xyplot(cpucap~date|zone,data=df,type="l",groups=newpool,auto.key=list(points=F,lines=T),
main=paste(df$server[1]," CPU C...
2008 Jun 28
0
ungrouped data for multinomial regression
Thanks for helping me out with the thing of quotation marks. I finally
could save time running programs at the university and home.
One additional question for all of you. I'm starting to be familiar
with multinomial regression models. Actually I'm doing some exercise
with the pneumo data that appears in Faraway library. The database has
24 observations and I want to study the probability
2010 Dec 29
1
logistic regression with response 0,1
Dear Masters,
first I'd like to wish u all a great 2011 and happy holydays by now,
second (here it come the boring stuff) I have a question to which I hope u
would answer:
I run a logistic regression by glm(), on the following data type
(y1=1,x1=x1); (y2=0,x2=x2);......(yn=0,xn=xn), where the response (y) is
abinary outcome on 0,1 amd x is any explanatory variable (continuous or not)
2004 Feb 20
3
problem with abline for x.y
...9;s data, with both regression
lines and data ellipses,
and I must be doing something wrong, because the lines do not intersect
at \bar{x}, \bar{y}.
The problem is likely in the line for x.y, but I don't know how to
specify that correctly.
The data is read in grouped form( galton), and then ungrouped (galton2):
galton <- read.table("~/sasuser/data/galton.txt", header=TRUE)
# ungroup
galton2<-galton[rep(1:nrow(galton), galton$frequency), 1:2]
attach(galton)
sunflowerplot(child, parent, number=frequency, xlim=c(61,75),
ylim=c(61,75),
xlab="Child height", ylab=&q...
2020 Nov 24
2
Cambiar nombre de topic en análisis LDA
...me gustaría cambiar el nombre de los
topics a la hora de visualizarlos y en vez de que se llamen 1,2,3...darles
un nombre. ¿Es posible en este código?
lda22 <- LDA(reviews_dtm, k = 22, control = list(seed = 1234))
lda22 %>%
tidy() %>%
group_by(topic) %>%
top_n(10, beta) %>%
ungroup() %>%
mutate(term = reorder_within(term, beta, topic)) %>%
ggplot(aes(term, beta, fill = factor(topic))) +
geom_col(show.legend = FALSE) +
facet_wrap(~ topic, scales = "free_y") +
coord_flip() +
scale_x_reordered()
Muchas gracias
2009 Dec 13
2
O(N log N) Kendall Tau
I've noticed that the implementation of Kendall's Tau in R is O(N^2).
The following reference describes how it can be done in O(N log N):
A Computer Method for Calculating Kendall's Tau with Ungrouped Data
William R. Knight
Journal of the American Statistical Association, Vol. 61, No. 314, Part
1 (Jun., 1966), pp. 436-439
http://www.jstor.org/pss/2282833
I'm interested in contributing an implementation of this algorithm to
R. However, I have a few questions:
1. Would it likely be...
2004 Dec 20
2
Producing "Editable" Graphs for PowerPoint
...e me to submit graphs that are
"editable in PowerPoint". I would be grateful for suggestions as to
how I should do this.
The best route seems to be to copy-and-paste the figures from the
windows() device as a metafile. However, on converting the graphs to
an editable format and "ungrouping" them, it appears that every line,
tickmark, dot and dash is treated as a separate entity by PowerPoint
(for example even the horizontal and vertical parts of "+" are
separated). Alternatively, reading in the files from a saved metafile
is even more problematic: having used par(...
2018 May 30
2
Filtering using multiple rows in dplyr
Hi Folks,
I have just started using dplyr and could use some help getting unstuck. It could well be that dplyr is not the package to be using, but let me just pose the question and seek your advice.
Here is my basic data frame.
head(h)
subject ageGrp ear hearingGrp sex freq L2 Ldp Phidp NF SNR
1 HALAF032 A L A F 2 0 -23.54459 55.56005 -43.08282
2017 Jul 20
2
dynamically create columns using a function
...= lazyeval::interp(~round(((a - mean(a[IS_GG ==
"YES"], na.rm = TRUE))/mean(a[IS_GG == "YES"], na.rm = TRUE)) *
100, 1), a = as.name(col))
dataset %>% group_by(TEST_SET_NAME) %>% mutate_(.dots = setNames(list(mutate_call),
col_name)) %>% ungroup()
}
# run function
results_demo<- demo_fn(dat = dem)
# expected results
structure(list(id = c("L1", "L2", "L3", "M1", "M2", "M3"), TEST_SET_NAME = c("A",
"A", "A", "B", "B", "...
2002 Jun 21
2
a question on statistics (rather than R-specific)
I have used plor() to model a rather large 3-category dataset (~1500 data
points, ~15 independent variables); from the resulting model (with a
deviance slightly below the residual degrees of freedom), the training data
are placed in only the two extreme categories. Though the result appears to
indicate that there's only a relative 'narrow' bin for the medium group,
[and when the
2017 Jul 21
0
dynamically create columns using a function
...S_GG ==
>
> "YES"], na.rm = TRUE))/mean(a[IS_GG == "YES"], na.rm = TRUE)) *
>
> 100, 1), a = as.name(col))
>
> dataset %>% group_by(TEST_SET_NAME) %>% mutate_(.dots =
> setNames(list(mutate_call),
>
> col_name)) %>% ungroup()
>
> }
>
>
> # run function
> results_demo<- demo_fn(dat = dem)
>
> # expected results
>
> structure(list(id = c("L1", "L2", "L3", "M1", "M2", "M3"), TEST_SET_NAME =
> c("A",
>
> "...
2005 Sep 04
1
specification for glmmPQL
...onstructed two types of data sets. On Rfile-01.Rdata (attached here)
are data frames, data.1 and data.2. The information is identical but the
data are arranged differently between these two data frames. Data frame,
data.1, groups frequencies by subject, day and treatment. Data frame,
data.2, is ungrouped.
Consistency of these data frames is substantiated by computing these
tables:
ftable(xtabs(response ~ expt + subject + day,
data = data.1))
ftable(xtabs(as.numeric(response) - 1 ~ expt + subject + day,
data = data.2))
If I ignore the repeated measurement aspect of th...
2010 Jul 07
1
Different goodness of fit tests leads to contradictory conclusions
I am trying to test goodness of fit for my legalistic regression using several options as shown below. Hosmer-Lemeshow test (whose function I borrowed from a previous post), Hosmer–le Cessie omnibus lack of fit test (also borrowed from a previous post), Pearson chi-square test, and deviance test. All the tests, except the deviance tests, produced p-values well above 0.05. Would anyone please
2011 Apr 15
3
GLM output for deviance and loglikelihood
It has always been my understanding that deviance for GLMs is defined
by;
D = -2(loglikelihood(model) - loglikelihood(saturated model))
and this can be calculated by (or at least usually is);
D = -2(loglikelihood(model))
As is done so in the code for 'polr' by Brian Ripley (in the package
'MASS') where the -loglikehood is minimised using optim;
res <-
2018 May 28
3
How to generate a conditional dummy in R?
...This is the code:
dat2 <- dat1 %>%
group_by(country) %>%
group_by(grp = cumsum(is.na(lag(Y))), add = TRUE) %>%
mutate(first_year_at_1 = match(1, Y) * any(is.na(Y)) * any(tail(Y, 3) == 1L),
X = {x <- integer(length(Y)) ; x[first_year_at_1] <- 1L ; x}) %>%
ungroup()
It doesn?t really generate what I described above. Any help here would be much appreciated.
Below you can see my sample data with the desired outcome ?X? dummy in it.
Thank you!
> dput(data)
structure(list(year = c(1991L, 1992L, 1993L, 1994L, 1995L, 1996L,
1997L, 1998L, 1999L, 2000L, 20...
2001 Aug 08
3
"Transparent" background in graphics exported as metafiles
...represented by a filled rectangle (with the color given by
bg=...). This is to be expected. However, I find no options to disable this
and produce a graph with transparent background. Does such an option exist?
If not, then this could be a useful addition, because it is tricky to edit
the metafile, ungroup de elements, select the background rectangle, delete
it, regroup all the other elements and save the graph in a graphic pachage
just to get transparent background on the graph... This could be simply
bg=False.
Thanks,
Philippe Grosjean
P.S.: I really appreciate the changes made to exported graphs...