How to create compass plot graph in Excel? - excel

I really enjoy the format of the political compass I have seen online, I was wondering if it's possible to create my own using x and y axis?
Here are my data that I wish to graph:
"Stamford, CT",-38,-25
"Atlanta, GA",-31,-37
"Melbourne, FL",-27,-38
"Huntsville, AL",-26,-39
"Houston, TX",-28,-32
"San Jose, CA",-39,-15
"Oakland, CA",-34,-14
"Fairfax, VA",-33,-7
"Pensacola, FL",-16,-28
"Dallas, TX",-14,-33
"Hartford, CT",-29,-10
"Detroit, MI",-18,-35
"New Haven, CT",-25,-27
"Chicago, IL",-30,-11
"Lansing, MI",-12,-36
"Charlotte, NC",-23,-22
"Savannah, GA",-17,-34
"Wilmington, NC",-19,-13
"Brooklyn, NY",-36,25
"Saint Louis, MO",-11,-23
"Spokane, WA",9,-31
"Ann Arbor, MI",-13,-19
"West Palm Beach, FL",-9,0
"Baltimore, MD",-20,2
"Bellingham, WA",1,-4
"Boston, MA",-32,20
"Jacksonville, FL",7,-21
"Columbus, OH",-6,-16
"Medford, OR",-8,-30
"San Antonio, TX",14,-24
"Fort Lauderdale, FL",-2,1
"Seattle, WA",-21,23
"Memphis, TN",16,-26
"Sacramento, CA",-15,7
"New York, NY",-37,34
"Kansas City, MO",8,-17
"San Francisco, CA",-35,35
"Akron, OH",19,-29
"Austin, TX",0,5
"Orlando, FL",17,-1
"Los Angeles, CA",-22,18
"Raleigh, NC",-1,3
"Iowa City, IA",6,-20
"Greenville, SC",4,-2
"Princeton, NJ",-24,31
"Cincinnati, OH",3,14
"Tampa, FL",26,-8
"Miami, FL",2,21
"Des Moines, IA",5,4
"Grand Rapids, MI",11,10
"Portland, OR",-7,15
"Denver, CO",-3,17
"Asheville, NC",-4,24
"Oklahoma City, OK",24,-18
"Reno, NV",31,-6
"Indianapolis, IN",23,-12
"Milwaukee, WI",13,-3
"Salt Lake City, UT",18,-9
"San Diego, CA",-10,27
"Cleveland, OH",20,22
"Tucson, AZ",29,-5
"Fresno, CA",10,11
"New Orleans, LA",21,9
"Las Vegas, NV",30,13
"Irvine, CA",-5,32
"Phoenix, AZ",28,6
"Madison, WI",15,19
"Buffalo, NY",27,12
"Burlington, VT",12,33
"Albuquerque, NM",32,8
"Pittsburgh, PA",25,29
"Louisville, KY",33,16
"Minneapolis, MN",22,28
"Boise, ID",36,26
"Rochester, NY",35,30
"Anchorage, AK",34,36
"Honolulu, HI",37,37

You would have to create dummy values, for example the table below:
A B
1 5
2 4
3 3
4 2
5 1
-1 -5
-2 -4
-3 -3
-4 -2
-5 -1
would produce the following graph:
You would have to decide how to transform your values, whether certain values should be converted to negatives or whether it would be better to standardise them and manipulate the axis placement. In a word, the task boils down to manufacturing a distribution where values fell in proportional distances from some arbitrary point where you want for your axis to be, zero in my example.

Related

How do i analyze goodness of fit between two contingency tables?

I have two contingency tables that I performed a chi-square test on. I would like to know if these two tables have similar distributions/frequency of the data using a goodness of fit test. I'm not sure how to do this and how to format the data. Thanks in advance for your help!
discharge = data.frame (decreasing.sign =c(0,0,9,7,1,1 ),
decreasing.trend= c(2,3,35,27,8,6),
increase.trend = c(8,27,34,16,4,3),
increase.sign = c(0,2,7,0,0,0),
row.names= c("Ridge and Valley", "Blue Ridge", "Piedmont", "Southeastern Plains", "Middle Atlantic Coastal Plain","Southern Coastal Plain"))
groundwater = data.frame (decreasing.sign =c(0,1,6,45,6,16),
decreasing.trend= c(0, 1, 3,28, 5,5),
increase.trend = c(1,5,6,32,9,5),
increase.sign = c(1,0,0,4,2,20),
row.names= c("Ridge and Valley", "Blue Ridge", "Piedmont", "Southeastern Plains", "Middle Atlantic Coastal Plain","Southern Coastal Plain"))
chisq=chisq.test(discharge) #add ",simulate.p.value" if there are zeros within parentheses
chisq
chisq2=chisq.test(groundwater) #add ",simulate.p.value" if there are zeros within parentheses
chisq2

Printing different image for different list data

so i made a list and i used tkinter for choosing a random data in list and showing that in a showinfo box. now i was just wondering if its possible to make a random image for random data.
for eg i am making a app that generates a random anime name from the list but i want to add the anime picture also is there any way i can do that ?
i haven't tried building it but here is what i have made so far.
i have no error i just want to have different picture for different names from the list chose randomly
import random
from tkinter import*
from tkinter import messagebox
anime = [
"1 Ore ga Ojousama Gakkou ni ' Shomin Sample' Toshite Gets♥Sareta Ken",
"2 Ookami to Koushinryou II",
"3 Ookami to Koushinryou",
"4 Grisaia no Kajitsu",
"5 Nyanko Days",
"6 Suzumiya Haruhi no Shoushitsu",
"7 Ookami Kodomo no Ame to Yuki",
"8 Sankarea",
"9 Boku no Hero Academia the Movie 2: Heroes Rising",
"10 Tensei shitara Slime Datta Ken OVA",
"11 Nakitai Watashi wa Neko wo Kaburu ",
"12 Tensei shitara Slime Datta Ken",
"13 Nande Koko ni Sensei ga!?",
"14 Kotonoha no Niwa",
"15 Chuunibyou demo Koi ga Shitai! Movie: Take On Me",
"16 Byousoku 5 Centimeter",
"17 Summer Wars",
"18 Tenki no Ko ",
"19 Kimi no Na wa.",
"20 Sword Art Online: Alicization – War of Underworld",
"21 Hinamatsuri",
"22 Gakuen Babysitters ",
"23 Yahari Ore no Seishun Love Comedy wa Machigatteiru. Zoku",
"24 Yahari Ore no Seishun Love Comedy wa Machigatteiru.",
"25 Hataraku Maou-sama!",
"26 Shokugeki no Souma: Shin no Sara",
"27 Shokugeki no Souma: San no Sara – Toutsuki Ressha-hen",
"28 Sewayaki Kitsune no Senko-san",
"29 Shokugeki no Souma: San no Sara",
"30 Shokugeki no Souma: Ni no Sara",
"31 Shokugeki no Soma ",
"32 Ao no Exorcist ",
"33 Ao no Exorcist: Kyoto Fujouou-hen",
"34 Boku dake ga Inai Machi",
"35 Kono Subarashii Sekai ni Shukufuku wo!: Kurenai Densetsu",
"36 Hyouka",
"37 Kami no Tou",
"38 Youkoso Jitsuryoku Shijou Shugi no Kyoushitsu e",
"39 Shingeki no Kyojin Season 3",
"40 Kaguya-sama wa Kokurasetai?: Tensai-tachi no Renai Zunousen 2nd Season",
"41 Shingeki no Kyojin Season 3 Part 2",
"42 Shingeki no Kyojin Season 2",
"43 Shingeki no Kyojin ",
"44 Kono Subarashii Sekai ni Shukufuku wo! 2",
"45 Seishun Buta Yarou wa Yumemiru Shoujo no Yume wo Minai",
"46 Kono Subarashii Sekai ni Shukufuku wo!",
"47 Seishun Buta Yarou wa Bunny Girl Senpai no Yume wo Minai",
"48 Sakurasou no Pet na Kanojo",
"49 Tate no Yuusha no Nariagari",
"50 IS: Infinite Stratos",
"51 Kawaikereba Hentai demo Suki ni Natte Kuremasu ka?",
"52 Enen no Shouboutai",
"53 Kaguya-sama wa Kokurasetai: Tensai-tachi no Renai Zunousen",
"54 Chuunibyou demo Koi ga Shitai! Ren",
"55 Koe no Katachi ",
"56 Dr. Stone",
"57 One Punch Man",
"58 Naruto Shippuden",
"59 Sword Art Online II",
"60 Sword Art Online",
"61 Ansatsu Kyoushitsu 2nd season",
"62 Ansatsu Kyoushitsu",
"63 Chuunibyou demo Koi ga Shitai!",
"64 Kimetsu no Yaiba",
"65 Re:Zero kara Hajimeru Isekai Seikatsu",
"66 Nanatsu no Taizai",
"67 Steins;Gate 0",
"68 Steins;Gate",
"69 Nanatsu no Taizai: Imashime no Fukkatsu",
"70 Tokyo Ghoul √A",
"71 One Punch Man Season 2",
"72 Hunter x Hunter (2011)",
"73 Darling in the FranXX",
"74 Tokyo Ghoul",
"75 Boku no Hero Academia 3rd Season.",
"76 Boku no Hero Academia",
"77 Nanatsu no Taizai: Kamigami no Gekirin",
"78 Naruto",
"79 Boku no Hero Academia 4th Season",
"80 Arte",
"81 Yakusoku no Neverland",
"82 Aho Girl",
"83 Wotaku ni Koi wa Muzukashii",
"84 Kimi no Suizou wo Tabetai ",
"85 Sakasama no Patema",
"86 Grisaia no Rakuen",
"87 Kimi ni Todoke",
"88 Kimi ni Todoke 2nd Season",
"89 Sukitte Ii na yo.",
"90 Ore wo Suki nano wa Omae dake ka yo",
"91 Koi To Uso",
"92 Saijaku Muhai no Bahamut",
"93 7 seeds",
"94 7 Seeds 2nd Season",
"95 Kono Yo no Hate de Koi wo Utau Shoujo YU-NO",
"96 Gotoubun no Hanayome",
"97 Masamune-kun no Revenge",
"98 Tokyo Magnitude 8.0",
"99 Keppeki Danshi! Aoyama-kun Episode ",
"100 Ao Haru Ride",
"101 Kakegurui",
"102 Kakegurui××",
"103 Tokyo Ghoul:re",
"104 Tokyo Ghoul:re 2nd season",
"105 Toradora!",
"106 Sounan Desu ka?",
"107 Denpa Onna to Seishun Otoko",
"108 Zenonzard The Animation",
"109 Hanamaru Kindergarden",
"110 Tonari no Kaibutsu-kun",
"111 Domestic na Kanojo",
"112 Haikyuu!!",
"113 Haikyuu!! Second Season",
"114 Haikyuu!!: Karasuno Koukou vs. Shiratorizawa Gakuen Koukou",
"115 Haikyuu!!: To the Top",
"116 Sword Art Online: Alicization – War of Underworld 2nd Season",
"117 Haikyuu!!: To the Top",
"118 Yahari Ore no Seishun Love Comedy wa Machigatteiru. Kan",
"119 Kanojo, Okarishimasu",
"120 Shokugeki no Souma: Gou no Sara",
"121 Maou Gakuin no Futekigousha: Shijou Saikyou no Maou no Shiso, Tensei shite Shison-tachi no Gakkou e",
"122 UZAKI-CHAN WA ASOBITAI!",
"123 ReLIFE",
"124 ReLIFE: Kanketsu-hen",
"125 The God of High School",
"126 Inou-Battle wa Nichijou-kei no Naka de",
"127 Kyoukai no Kanata",
"128 Arifureta Shokugyou de Sekai Saikyou",
"129 ISEKAI MAOU TO SHOUKAN SHOUJO NO DOREI MAJUTSU",
"130 AKAME GA KILL!",
"131 Re:Zero kara Hajimeru Isekai Seikatsu 2nd Season",
"132 Shinchou Yuusha: Kono Yuusha ga Ore Tueee Kuse ni Shinchou Sugiru",
"133 Noragami",
"134 Noragami OVA",
"135 Noragami Aragoto",
"136 Nisekoi",
"137 Nisekoi:",
"138 Black Bullet",
"139 Devils Line",
"140 TABOO TATTOO",
"141 Hajimete no Gal ",
"142 Kuzu no Honkai",
"143 Tsurezure Children",
"144 Himouto! Umaru-chan",
"145 Boku no Kanojo ga Majimesugiru Sho-bitch na Ken",
"146 Bungou Stray Dogs",
"147 Bungou Stray Dogs Season 2",
"148 Bungou Stray Dogs 3rd Season",
"149 Lovely★Complex",
"150 Plunderer",
"151 TONIKAKU KAWAII",
"152 Enen no Shouboutai: Ni no Shou",
"153 Haikyuu!!: To the Top 2nd Season",
"154 Shigatsu wa Kimi no Uso",
"155 Kaichou wa Maid-sama",
"156 Karakai Jouzu no Takagi-san",
"157 Karakai Jouzu no Takagi-san 2"]
top = Tk()
top.geometry("200x100")
def fun():
messagebox.showinfo("Anime", random.choice(anime))
can = Canvas(top, height = 100, width = 100)
can.place(relx=0.5, rely=0.5, anchor=CENTER)
b1 = Button(can,text = "Generate",command = fun,activeforeground = "black",activebackground = "yellow",pady=10)
b1.pack(side = TOP)
top.mainloop()
Since you want the image to be corresponding to the anime titles I suggest you use a dictionary instead of a list. Also, use Toplevel widget to display the output.
So here is an example code:
import random
from tkinter import*
from PIL import Image, ImageTk
absolute_path = r'C:\Users\ ' # your absolute path goes here(Note: Don't remove the extra space in the end)
anime = {
"1 Ore ga Ojousama Gakkou ni ' Shomin Sample' Toshite Gets♥Sareta Ken": 'Akira.png', # anime image name
"2 Ookami to Koushinryou II": 'Alex.jpg', # anime image name
}
root = Tk()
root.geometry("200x100")
def fun():
top = Toplevel(root)
top.title('Anime')
random_choice = random.choice(list(anime.keys())) #choosing random from dictionary keys
label = Label(top, text=random_choice)
label.pack()
top.img = ImageTk.PhotoImage(Image.open(absolute_path.strip()+anime[random_choice]))
image_label = Label(top, image=top.img)
image_label.pack()
can = Canvas(root, height = 100, width = 100)
can.place(relx=0.5, rely=0.5, anchor=CENTER)
b1 = Button(can,text = "Generate",command = fun,activeforeground = "black",activebackground = "yellow",pady=10)
b1.pack(side = TOP)
root.mainloop()

How to search for specific text in csv within a Pandas, python

Hello I want to find the account text # in the title column, and save it in the new csv. Pandas can do it, I tried to make it but it didn't work.
This is my csv http://www.sharecsv.com/s/c1ed9790f481a8d452049be439f4e3d8/Newnormal.csv
this is my code:
import pandas as pd
data = pd.read_csv("Newnormal.csv")
data.dropna(inplace = True)
sub ='#'
data["Indexes"]= data["title"].str.find(sub)
print(data)
I want results like this
From, to, title Xavier5501,KudiiThaufeeq,RT #KudiiThaufeeq: Royal
Rape, Royal Harassment, Royal Cocktail Party, Royal Pedo, Royal
Bidding, Royal Maalee Bayaan, Royal Slavery..et
Thank you.
reduce records to only those that have an "#" in title
define new column which is text between "#" and ":"
you are left with some records where this leave NaN in to column. I've just filtered these out
df = pd.read_csv("Newnormal.csv")
df = df[df["title"].str.contains("#")==True]
df["to"] = df["title"].str.extract(r".*([#][A-Z,a-z,0-9,_]+[:])")
df = df[["from","to","title"]]
df[~df["to"].isna()].to_csv("ToNewNormal.csv", index=False)
df[~df["to"].isna()]
output
from to title
1 Xavier5501 #KudiiThaufeeq: RT #KudiiThaufeeq: Royal Rape, Royal Harassmen...
2 Suzane24979006 #USAID_NISHTHA: RT #USAID_NISHTHA: Don't step outside your hou...
3 sandeep_sprabhu #USAID_NISHTHA: RT #USAID_NISHTHA: Don't step outside your hou...
4 oliLince #Timothy_Hughes: RT #Timothy_Hughes: How to Get a Salesforce Th...
7 rismadwip #danielepermana: RT #danielepermana: Pak kasus covid per hari s...
... ... ... ...
992 Reptoid_Hunter #sapiofoxy: RT #sapiofoxy: I literally can't believe we ha...
994 KPCResearch #sapiofoxy: RT #sapiofoxy: I literally can't believe we ha...
995 GreySparkUK #VoxSmartGlobal: RT #VoxSmartGlobal: The #newnormal will see mo...
997 Gabboa10 #HuShameem: RT #HuShameem: One of #PGO_MV admin staff test...
999 wanjirunjendu #ntvkenya: RT #ntvkenya: AAK's Mugure Njendu shares insig...

Reformat csv file using python?

I have this csv file with only two entries. Here it is:
Meat One,['Abattoirs', 'Exporters', 'Food Delivery', 'Butchers Retail', 'Meat Dealers-Retail', 'Meat Freezer', 'Meat Packers']
First one is title and second is a business headings.
Problem lies with entry two.
Here is my code:
import csv
with open('phonebookCOMPK-Directory.csv', "rt") as textfile:
reader = csv.reader(textfile)
for row in reader:
row5 = row[5].replace("[", "").replace("]", "")
listt = [(''.join(row5))]
print (listt[0])
it prints:
'Abattoirs', 'Exporters', 'Food Delivery', 'Butchers Retail', 'Meat Dealers-Retail', 'Meat Freezer', 'Meat Packers'
What i need to do is that i want to create a list containing these words and then print them like this using for loop to print every item separately:
Abattoirs
Exporters
Food Delivery
Butchers Retail
Meat Dealers-Retail
Meat Freezer
Meat Packers
Actually I am trying to reformat my current csv file and clean it so it can be more precise and understandable.
Complete 1st line of csv is this:
Meat One,+92-21-111163281,Al Shaheer Corporation,Retailers,2008,"['Abattoirs', 'Exporters', 'Food Delivery', 'Butchers Retail', 'Meat Dealers-Retail', 'Meat Freezer', 'Meat Packers']","[[' Outlets Address : Shop No. Z-10, Station Shopping Complex, MES Market, Malir-Cantt, Karachi. Landmarks : MES Market, Station Shopping Complex City : Karachi UAN : +92-21-111163281 '], [' Outlets Address : Shop 13, Ground Floor, Plot 14-D, Sky Garden, Main Tipu Sultan Road, KDA Scheme No.1, Karachi. Landmarks : Nadra Chowrangi, Sky Garden, Tipu Sultan Road City : Karachi UAN : +92-21-111163281 '], ["" Outlets Address : Near Jan's Broast, Boat Basin, Khayaban-e-Roomi, Block 5, Clifton, Karachi. Landmarks : Boat Basin, Jans Broast, Khayaban-e-Roomi City : Karachi UAN : +92-21-111163281 View Map ""], [' Outlets Address : Gulistan-e-Johar, Karachi. Landmarks : Perfume Chowk City : Karachi UAN : +92-21-111163281 '], [' Outlets Address : Tee Emm Mart, Creek Vista Appartments, Khayaban-e-Shaheen, Phase VIII, DHA, Karachi. Landmarks : Creek Vista Appartments, Nueplex Cinema, Tee Emm Mart, The Place City : Karachi Mobile : 0302-8333666 '], [' Outlets Address : Y-Block, DHA, Lahore. Landmarks : Y-Block City : Lahore UAN : +92-42-111163281 '], [' Outlets Address : Adj. PSO, Main Bhittai Road, Jinnah Supermarket, F-7 Markaz, Islamabad. Landmarks : Bhittai Road, Jinnah Super Market, PSO Petrol Pump City : Islamabad UAN : +92-51-111163281 ']]","Agriculture, fishing & Forestry > Farming equipment & services > Abattoirs in Pakistan"
First column is Name
Second column is Number
Third column is Owner
Forth column is Business type
Fifth column is Y.O.E
Sixth column is Business Headings
Seventh column is Outlets (List of lists containing every branch address)
Eighth column is classification
There is no restriction of using csv.reader, I am open to any technique available to clean my file.
Think of it in terms of two separate tasks:
Collect some data items from a ‘dirty’ source (this CSV file)
Store that data somewhere so that it’s easy to access and manipulate programmatically (according to what you want to do with it)
Processing dirty CSV
One way to do this is to have a function deserialize_business() to distill structured business information from each incoming line in your CSV. This function can be complex because that’s the nature of the task, but still it’s advisable to split it into self-containing smaller functions (such as get_outlets(), get_headings(), and so on). This function can return a dictionary but depending on what you want it can be a [named] tuple, a custom object, etc.
This function would be an ‘adapter’ for this particular CSV data source.
Example of deserialization function:
def deserialize_business(csv_line):
"""
Distills structured business information from given raw CSV line.
Returns a dictionary like {name, phone, owner,
btype, yoe, headings[], outlets[], category}.
"""
pieces = [piece.strip("[[\"\']] ") for piece in line.strip().split(',')]
name = pieces[0]
phone = pieces[1]
owner = pieces[2]
btype = pieces[3]
yoe = pieces[4]
# after yoe headings begin, until substring Outlets Address
headings = pieces[4:pieces.index("Outlets Address")]
# outlets go from substring Outlets Address until category
outlet_pieces = pieces[pieces.index("Outlets Address"):-1]
# combine each individual outlet information into a string
# and let ``deserialize_outlet()`` deal with that
raw_outlets = ', '.join(outlet_pieces).split("Outlets Address")
outlets = [deserialize_outlet(outlet) for outlet in raw_outlets]
# category is the last piece
category = pieces[-1]
return {
'name': name,
'phone': phone,
'owner': owner,
'btype': btype,
'yoe': yoe,
'headings': headings,
'outlets': outlets,
'category': category,
}
Example of calling it:
with open("phonebookCOMPK-Directory.csv") as f:
lineno = 0
for line in f:
lineno += 1
try:
business = deserialize_business(line)
except:
# Bad line formatting?
log.exception(u"Failed to deserialize line #%s!", lineno)
else:
# All is well
store_business(business)
Storing the data
You’ll have the store_business() function take your data structure and write it somewhere. Maybe it’ll be another CSV that’s better structured, maybe multiple CSVs, a JSON file, or you can make use of SQLite relational database facilities since Python has it built-in.
It all depends on what you want to do later.
Relational example
In this case your data would be split across multiple tables. (I’m using the word “table” but it can be a CSV file, although you can as well make use of an SQLite DB since Python has that built-in.)
Table identifying all possible business headings:
business heading ID, name
1, Abattoirs
2, Exporters
3, Food Delivery
4, Butchers Retail
5, Meat Dealers-Retail
6, Meat Freezer
7, Meat Packers
Table identifying all possible categories:
category ID, parent category, name
1, NULL, "Agriculture, fishing & Forestry"
2, 1, "Farming equipment & services"
3, 2, "Abattoirs in Pakistan"
Table identifying businesses:
business ID, name, phone, owner, type, yoe, category
1, Meat One, +92-21-111163281, Al Shaheer Corporation, Retailers, 2008, 3
Table describing their outlets:
business ID, city, address, landmarks, phone
1, Karachi UAN, "Shop 13, Ground Floor, Plot 14-D, Sky Garden, Main Tipu Sultan Road, KDA Scheme No.1, Karachi", "Nadra Chowrangi, Sky Garden, Tipu Sultan Road", +92-21-111163281
1, Karachi UAN, "Near Jan's Broast, Boat Basin, Khayaban-e-Roomi, Block 5, Clifton, Karachi", "Boat Basin, Jans Broast, Khayaban-e-Roomi", +92-21-111163281
Table describing their headings:
business ID, business heading ID
1, 1
1, 2
1, 3
…
Handling all this would require a complex store_business() function. It may be worth looking into SQLite and some ORM framework, if going with relational way of keeping the data.
You can just replace the line :
print(listt[0])
with :
print(*listt[0], sep='\n')

In Stata, how can I group coefplot's means across categorical variable?

I'm working with coefplot command (source, docs) in Stata plotting means of continuous variable over cateories.
Small reporoducible example:
sysuse auto, clear
drop if rep78 < 3
la de rep78 3 "Three" 4 "Four" 5 "Five"
la val rep78 rep78
mean mpg if foreign == 0, over(rep78)
eststo Domestic
mean mpg if foreign == 1, over(rep78)
eststo Foreign
su mpg, mean
coefplot Domestic Foreign , xtitle(Mpg) xline(`r(mean)')
Gives me result:
What I'd like to add is an extra 'group' label for Y axis. Trying options from regression examples doesn't seem to do the job:
coefplot Domestic Foreign , headings(0.rep78 = "Repair Record 1978")
coefplot Domestic Foreign , groups(?.rep78 = "Repair Record 1978")
Any other possibilities?
This seems to do the job
coefplot Domestic Foreign , xtitle(Mpg) xline(`r(mean)') ///
groups(Three Four Five = "Repair Record 1978")
I don't know however how it will handle situations with categorical variables with the same labels?

Resources