Comments (2)
The documentation could be improved.... and perhaps supplemented with examples.
load("~/Downloads/example.Rdata")
(mm <- mixingmatrix(fgf, "gender"))
#> To
#> From 0 1 Sum
#> 0 28 2 30
#> 1 7 66 73
#> Sum 35 68 103
Numeric vector is interpreted as an index of the cells of the mixing matrix (in the usual column order):
summary(fgf ~ nodemix("gender", levels2=1)) # (1,1)
#> mix.gender.0.0
#> 28
summary(fgf ~ nodemix("gender", levels2=3)) # (2,1)
#> mix.gender.0.1
#> 2
summary(fgf ~ nodemix("gender", levels2=2:3)) # (1,2) and (2,1)
#> mix.gender.1.0 mix.gender.0.1
#> 7 2
Character vector is interpreted as a matrix, it collapses/aggregates the cells assigned the same values:
summary(fgf ~ nodemix("gender", levels2=c("foo", "foo", "bar", "bar")))
#> mix.gender.bar mix.gender.foo
#> 68 35
colSums(mm)
#> 0 1
#> 35 68
because
matrix(c("foo", "foo", "bar", "bar"), 2, 2)
#> [,1] [,2]
#> [1,] "foo" "bar"
#> [2,] "foo" "bar"
and this is interpreted as matrix(βfoobarβ, 2, 2)
so sums the whole matrix:
summary(fgf ~ nodemix("gender", levels2="foobar"))
#> mix.gender.foobar
#> 103
sum(mm)
#> [1] 103
I know nothing about parsing character vectors of the form βx.yβ.
from ergm.
The documentation could, indeed, be much better. If you want to select level pairs explicitly, you need to pass something like
summary(fgf ~ nodemix("gender", levels2 = I(list(list(row=1,col=0),list(row=0,col=1)))))
mix.gender.1.0 mix.gender.0.1
7 2
I'll try to reply in more detail later.
from ergm.
Related Issues (20)
- ergm() misinterprets a dyad-dependent hint as a dyad-dependent sample-space constraint.
- In missing data MLE, ergm.estimate()'s Hessian based on the original matrices can be non-SPD, if the Hummel step length < 1.
- A scale for proposal and hint "scores"?
- I'm trying to construct a valued ERGM model using `ergm.count`, but the runtime is excessively long.
- Error installing ergm due to lpSolveAPI compilation error HOT 1
- Augment auxiliaries API to enable "eager" evaluation.
- Using an offset together with the Godambe information for the MPLE does not work HOT 3
- Bus error when running `ergm`: `address 0x0, cause 'invalid alignment'` HOT 8
- GOF documentation for bipartite networks
- Dyadic attributes and graph manipulation HOT 6
- edgecov() and dyadcov() should check that the covariate matrix is of the correct dimension.
- Consider calling glm.fit() instead of glm() HOT 1
- Optional MPLE existence check? HOT 1
- search.ergmTerms behavior -- returns bipartite terms for non-bipartite network HOT 6
- fixedas(present, absent) constraint does not actually ensure edges are present or absent. HOT 5
- Dropped terms appear to result in the estimated log-likelihood being NaN. HOT 7
- After dropping extreme values, MPLE and MLE likelihoods report different numbers of observations.
- ergm uses a non-API call SET_TYPEOF().
- 'ergm' and everything LinkingTo ergm should work with STRICT_R_HEADERS=1.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ergm.