Hello All,

First off, allow me to apologize in advance for any errors I make in the formatting of my questions. I have read the guidelines on how to ask a question here, however this is my first post on this website and I imagine I will make some missteps. I am using Windows 10 and Stata 13.

I am attempting to compare how different levels of sports participation affects various childhood outcomes using a single cycle of panel data (the linking variables are not publicly available). In the data, there are household identifiers and child identifiers. I would like to compare outcomes of children within the same household.

The -dataex- command gives the readout

Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input str7 cidhd01 str6 childid byte caccq3a float testfriends
"10001.0" "30614"   5 0
"10001.0" "30466"  .a 1
"10008.0" "19444"   3 0
"10008.0" "31860"   5 0
"10044.0" "15641"   5 0
"10044.0" "21414"  .a 1
"10061.0" "24090"   5 1
"10061.0" "23921"  .a 1
"10063.0" "19216"   2 0
"10063.0" "20489"  .a 1
"10079.0" "20354"   2 1
"10079.0" "10719"   5 1
"10089.0" "17517"   5 0
"10089.0" "2247.0" .a 1
"10098.0" "12280"   3 1
"10098.0" "31427"   5 1
"1011.00" "20948"   5 1
"1011.00" "30044"  .a 1
"10114.0" "27175"   3 1
"10114.0" "4606.0" .a 1
"10142.0" "31025"   5 1
"10142.0" "29072"  .a 1
"10143.0" "28203"   2 0
"10143.0" "27481"  .a 1
"10163.0" "10620"   2 0
"10163.0" "2052.0"  3 1
"10208.0" "15903"   2 0
"10208.0" "419.00" .a 1
"10214.0" "25338"   5 1
"10214.0" "22707"  .a 1
"10228.0" "29116"   3 0
"10228.0" "11936"   4 0
"10237.0" "21220"   3 1
"10237.0" "6407.0"  5 1
"10272.0" "3212.0"  5 0
"10272.0" "21989"  .a 1
"10291.0" "14900"   2 1
"10291.0" "20674"   3 1
"10307.0" "9807.0"  5 1
"10307.0" "21207"  .a 1
"10317.0" "25560"   5 0
"10317.0" "13886"  .a 1
"10341.0" "18982"   5 0
"10341.0" "6632.0" .a 1
"10359.0" "16555"   2 1
"10359.0" "11959"   3 1
"10383.0" "6550.0"  3 0
"10383.0" "20757"  .a 1
"10385.0" "12919"   5 1
"10385.0" "10928"  .a 1
"10400.0" "6645.0"  5 1
"10400.0" "24121"  .a 1
"10410.0" "15811"   3 0
"10410.0" "18497"  .a 1
"10456.0" "1988.0"  2 0
"10456.0" "10091"  .a 1
"10465.0" "441.00"  2 1
"10465.0" "26554"   3 0
"10466.0" "15278"   5 0
"10466.0" "2347.0" .a 1
"10475.0" "883.00"  3 1
"10475.0" "2021.0"  5 1
"10485.0" "18747"   3 1
"10485.0" "11622"  .a 1
"10499.0" "20003"   3 1
"10499.0" "22551"  .a 1
"10507.0" "16811"   5 1
"10507.0" "25939"  .a 1
"10509.0" "1102.0"  2 1
"10509.0" "5461.0" .a 1
"10535.0" "24443"   2 1
"10535.0" "29505"  .a 1
"10542.0" "6346.0"  4 1
"10542.0" "2297.0" .a 1
"10558.0" "16487"   2 1
"10558.0" "24114"  .d 1
"10585.0" "16482"   5 1
"10585.0" "24880"  .a 1
"10599.0" "2234.0"  2 1
"10599.0" "2651.0" .a 1
"1060.00" "23880"   5 0
"1060.00" "30314"  .a 1
"10606.0" "8148.0"  3 1
"10606.0" "29953"  .a 1
"1061.00" "26422"   3 1
"1061.00" "8280.0" .a 1
"10614.0" "6965.0"  2 0
"10614.0" "27418"   3 0
"10615.0" "5237.0"  5 0
"10615.0" "13526"  .a 1
"10635.0" "15913"  .a 1
"10635.0" "22441"  .d 1
"10639.0" "29368"   5 0
"10639.0" "10340"  .a 1
"10648.0" "18456"   3 1
"10648.0" "31156"  .a 1
"10649.0" "639.00"  5 1
"10649.0" "1542.0" .a 1
"10675.0" "27426"   2 1
"10675.0" "8195.0"  3 1
end
label values caccq3a CACCQ3A
label def CACCQ3A 2 "A FEW TIMES A WEEK", modify
label def CACCQ3A 3 "ABOUT ONCE A WEEK", modify
label def CACCQ3A 4 "ABOUT ONCE A MONTH", modify
label def CACCQ3A 5 "ALMOST NEVER", modify
Where cidhd01 is the household id, childid is the child id, the level of sports participation is coded as caccq3a, and testfriends is a dummy variable I generated only to help illustrate my question here. Testfriends checks if the child's parent believes they have more than 3 friends. Please note that I only include these variables in my -dataex- as the other variables are not particularly relevant to my question. There are 3676 observations in my restricted dataset. Households can have more than two responses.

The current relevant code I have is as follows

Code:
*Remove those children who are in a household with only one respondent and
*those children who participate in sport at equal amounts to other children in HH

bysort cidhd01 (caccq3a): gen byte nodiff = caccq3a[1] == caccq3a[_N]
drop if nodiff

probit testfriends i.caccq3a <other controls>

I am relatively new to Stata, and I am uncertain if, as the data is sorted using the -bysort- command, Stata recognizes that I want use the -probit- command to compare children to other children in the household.

I would like to know if this is the appropriate command, and if not, where I can find readings on how to better understand what Stata needs from me in order to solve this issue.

Thank you in advance, and again I apologize for any mistakes I make in asking this question.