Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Factor ordering for legends and summary model output #3

Open
martinamorris opened this issue Jul 26, 2014 · 4 comments
Open

Factor ordering for legends and summary model output #3

martinamorris opened this issue Jul 26, 2014 · 4 comments

Comments

@martinamorris
Copy link
Member

Current ordering is a bit odd. For example, look at faux.mesa. Here, alphabetic (with "other" at end) would be best, but may be difficult to achieve. Note that the same ordering would be useful for nodefactor and nodematch in the model output. If R is using the order encountered in the data, sorting might help, but: 1. i'm not sure how to sort a network object, and 2. achieving alphabetical order for multiple factors may not be possible; and 3. that wouldn't guarantee "other" at the end.

Worth looking at the "relevel" command -- maybe that will work here.

@ebey
Copy link
Collaborator

ebey commented Jul 28, 2014

I have ordered the factors in the legend to be alphabetic with "other" at the end.

I'm not sure I understand which part of the app you are referring to as summary model output, but if it is the Summary tab at the bottom of the Fit Model page:
It seems that factors are listed in the same order they are passed in the ergm formula. The order of the formula can be specified within the R code, currently it is the terms that don't require additional menu options, followed by those that do. Within those two categories the terms are somewhat in alphabetic order, the exception being that idegree and odegree are listed together in the same placement degree would be in.

@martinamorris
Copy link
Member Author

martinamorris commented Jul 28, 2014

On Mon, 28 Jul 2014, ebey wrote:

I have ordered the factors in the legend to be alphabetic with "other" at the end.

great.

I'm not sure I understand which part of the app you are referring to as summary model output, but if it is the
Summary tab at the bottom of the Fit Model page:

yes.

It seems that factors are listed in the same order they are passed in the ergm formula. The order of the formula
can be specified within the R code, currently it is the terms that don't require additional menu options, followed
by those that do. Within those two categories the terms are somewhat in alphabetic order, the exception being that
idegree and odegree are listed together in the same placement degree would be in.

i meant the ordering of factor levels, within term, and was referring to
the same ordering i was requesting in the plot legend. (but thx, i didn't
realize the ordering of terms was no-options + options).

@ebey
Copy link
Collaborator

ebey commented Jul 29, 2014

I see. The attribute names within term are in alphabetical order (I have control over this, but we don't need to worry about 'Other's), as are the factor levels (I don't have control over this, so 'Other' comes before 'White')

@martinamorris
Copy link
Member Author

martinamorris commented Jul 29, 2014

Right, that's why I was suggesting you take a look at the "relevel"
command in R.

But check out this page:
http://www.cookbook-r.com/Manipulating_data/Changing_the_order_of_levels_of_a_factor/

I suspect we would want to recreate the dataset with an ordered factor for
a future release of statnet.

This, like a few other things, make me realize that data manipulation will
need to be addressed at some point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants