Hi,
I've spent 5-6 hours browsing the help files and past posts, but could not find the answer to what seems to be a very simple procedure. I used UCINet and Pajek before and want to switch to STATA working with matrices.
I have two relational variables: students and classes that they are enrolled in. I want to create a square class-by-class matrix that would show the number of students in common in each class pair. This is very similar to the classic Southern Women study, albeit with a much larger data set. The initial two-variable dataset looks like this:
class student
1 1
1 2
1 3
1 4
1 5
2 2
2 3
2 5
3 1
3 5
4 2
4 4
4 5
I want to end up with (in the above example) 4x4 class matrix (with zeros in the diagonal). I appreciate any suggestion for Stata, Mata, or nwcommands.
Cheers,
Mikhail
Related Posts with Creating a square matrix using two relational variables
Interpreting outputs from "raschjmle" commandHi! I am doing my research on Rasch analysis for measuring knowledge. I am using Stata-14 to constru…
Descriptive statistics for panel dataHi Statalist, I'm struggling to generate the descriptive statistics for my dataset. Here is the exa…
Appropriate model to usehello, I have a question on the most appropriate model to use. I have the data set below, I am tryin…
Pause in results windowI use Stata/IC 14.2 for Mac (64-bit Intel). I'm looking for a solution where Stata can execute comma…
Counting number of variables across groupsHi, I have three variables KeyEventDates KeyEventHistory KeyEventDetails that I am splitting into s…
Subscribe to:
Post Comments (Atom)
0 Response to Creating a square matrix using two relational variables
Post a Comment