Hello all,

This question is a bit convoluted, so please bear with me.

I am working with Supreme Court data--the problem is that I have justice-level data and I need it to be case-level data.

I have a dataset organized by individual justice behavior. The data of interest is whether a justice wrote an opinion in a given case, which I have coded as 1 if so, and 0 if not. The goal is to take that individual-level data and condense it into case level data--so the variable would read not 0 or 1 for a particular justice, but the total number of justices who wrote an opinion per case (not 0 or 1 per justice, but anywhere from 1 to 9 per case).

Here's what I have done so far: I have a variable called "opinion_two" coded 0 or 1 for whether the justice wrote an opinion. By using a certain command, I can sum the total of opinion_two for a given case citation. That is, the following command:

by lexisCite, sort : count if opinion_two==1

gives the count of opinion_two organized per case citation. It gives me a printout of the raw data I need: the sum, per case, of opinion_two: the number of justices per case who wrote an opinion. This produces an enormous printout of the data I need, which looks like this (the following is a small copy-paste of the relevant data):

-> lexisCite = 2014 U.S. LEXIS 2932
5
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> lexisCite = 2014 U.S. LEXIS 3107
1
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> lexisCite = 2014 U.S. LEXIS 3108
2
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> lexisCite = 2014 U.S. LEXIS 3111
2
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> lexisCite = 2014 U.S. LEXIS 3992
3
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> lexisCite = 2014 U.S. LEXIS 4166
1
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> lexisCite = 2014 U.S. LEXIS 4167
2
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> lexisCite = 2014 U.S. LEXIS 4170
2


The LEXIS stuff refers to the citation of each Supreme Court case for which I want these data. The number is the sum of opinion_two per case. I want these data but in a different format: something like in an excel format (doesn't have to be excel but it has to have separate vectors for the lexis citation and the sum of opinion_two so I can easily enter the data into a different, case-centered dataset).

So, to sum up: the command above gives me a printout of the data for the ~2500 cases for which I need to enter the number of Supreme Court justices who wrote an opinion. The command above seems to give me what I need. What I need now is a way to translate this printout of data into a format I can use to enter these data into a new dataset, one organized not by justice but by case.

I have tried to investigate existing methods for exporting tables from Stata into excel, but to no avail so far. Ideally, the finished product would be organized into separate vectors like:

lexisCite (col 1) sum of opinion_two (col 2)
2014 U.S. LEXIS 2932 5
2014 U.S. LEXIS 3107 1
..... ....


At that point, I can very easily use the "replace" command to enter the data into my other dataset. Getting the data from the printout above into the format I describe here is the task.

I hope that this convoluted task makes sense to someone. Any ideas?

Thanks, all. Happy Sunday!
Gordon