CatPaws Tracker
https://communities.sas.com/kntur85557/tracker
CatPaws TrackerSat, 20 Jul 2024 01:02:10 GMT2024-07-20T01:02:10ZChi-Square WARNING
https://communities.sas.com/t5/Statistical-Procedures/Chi-Square-WARNING/m-p/800056#M39351
<P>Hi! I am doing a Chi-Square test to determine if the deaths are equal between two populations by age group. However, I get the warning below, which I'm not surprised about because some of the age groups had 0 deaths or >5. How do I proceed? </P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="CatPaws_1-1646366801325.png" style="width: 400px;"><img src="https://communities.sas.com/t5/image/serverpage/image-id/69132i4C84802C23E35FA2/image-size/medium?v=v2&px=400" role="button" title="CatPaws_1-1646366801325.png" alt="CatPaws_1-1646366801325.png" /></span></P><P> </P><P> </P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="CatPaws_0-1646366476870.png" style="width: 400px;"><img src="https://communities.sas.com/t5/image/serverpage/image-id/69131iEF7411CDABBFAFA0/image-size/medium?v=v2&px=400" role="button" title="CatPaws_0-1646366476870.png" alt="CatPaws_0-1646366476870.png" /></span></P><P>Title "Chi-Square of Deaths by Age";<BR />PROC FREQ data=AgeDeath;<BR />TABLE age*wave / CHISQ EXPECTED DEVIATION NOROW NOCOL NOPERCENT;<BR />format age agegrp.;<BR />RUN;</P>Fri, 04 Mar 2022 14:34:05 GMThttps://communities.sas.com/t5/Statistical-Procedures/Chi-Square-WARNING/m-p/800056#M39351CatPaws2022-03-04T14:34:05ZRe: Chi Square Test of Homogeneity
https://communities.sas.com/t5/Statistical-Procedures/Chi-Square-Test-of-Homogeneity/m-p/799407#M39323
<P>Hi Steve,</P><P> Thank you. Do you have any references or suggestions on how I code it based on the cutoff date?</P>Tue, 01 Mar 2022 18:27:13 GMThttps://communities.sas.com/t5/Statistical-Procedures/Chi-Square-Test-of-Homogeneity/m-p/799407#M39323CatPaws2022-03-01T18:27:13ZRe: Identifying same observations
https://communities.sas.com/t5/New-SAS-User/Identifying-same-observations/m-p/799082#M33120
Data set 1 would not have identical observations within the dataset. I need to identify obervations that are 100% identical between data sets. For example, I need to know if there is an oberservation in data set 1 that is also in data set 2 or vice versa.Mon, 28 Feb 2022 05:51:18 GMThttps://communities.sas.com/t5/New-SAS-User/Identifying-same-observations/m-p/799082#M33120CatPaws2022-02-28T05:51:18ZIdentifying same observations
https://communities.sas.com/t5/New-SAS-User/Identifying-same-observations/m-p/799039#M33117
<P>I have two data sets with the same variables, but different observations. I need to know if any observations in data set 1 are in data set 2. How do I do this? Do I merge them first?</P>Mon, 28 Feb 2022 00:54:49 GMThttps://communities.sas.com/t5/New-SAS-User/Identifying-same-observations/m-p/799039#M33117CatPaws2022-02-28T00:54:49ZRe: Chi Square Test of Homogeneity
https://communities.sas.com/t5/Statistical-Procedures/Chi-Square-Test-of-Homogeneity/m-p/798730#M39280
Now we are getting somewhere lol. Since my oberservation IDs are identified by numbers, it would be difficult to try to create a dummy variable for them since they follow no specific order, rhyme, or reason. However, what separates my two populations is a date range. My next question is how do you create an indicator variable using a date range? For example, group 1 is defined from Nov 1999-Jan 2000, and group two is defined as Feb 2000-April 2000. How would that look coded?Fri, 25 Feb 2022 19:31:14 GMThttps://communities.sas.com/t5/Statistical-Procedures/Chi-Square-Test-of-Homogeneity/m-p/798730#M39280CatPaws2022-02-25T19:31:14ZRe: Chi Square Test of Homogeneity
https://communities.sas.com/t5/Statistical-Procedures/Chi-Square-Test-of-Homogeneity/m-p/798689#M39274
<P>Hi Rick,</P><P> I think I understand what you are saying, but when I look at that document, it shows two Chi-Square test,( one for each region). I am only wanting to do one Chi-Square test, based off two different groups. I have attached a document that shows the frequency of sex, Females and Males,in Case group, as well as the frequency of sex3, Females and Males, in Case3 group. Since they are in two different data sets, how would I code this? </P><P> </P><P>*I will exclude the Unknown values before analysis, but I am more interested in how to set up the code right now</P>Fri, 25 Feb 2022 17:52:49 GMThttps://communities.sas.com/t5/Statistical-Procedures/Chi-Square-Test-of-Homogeneity/m-p/798689#M39274CatPaws2022-02-25T17:52:49ZChi Square Test of Homogeneity
https://communities.sas.com/t5/Statistical-Procedures/Chi-Square-Test-of-Homogeneity/m-p/798628#M39271
I am needing to do a Chi Square test of Homogeneity. I know how to do the Chi Square test of Independence, my issue is I have 2 datasets. One dataset for one population and another dataset (same variables) for the second population. Do I need to have these in the same dataset to do the test?Fri, 25 Feb 2022 16:14:16 GMThttps://communities.sas.com/t5/Statistical-Procedures/Chi-Square-Test-of-Homogeneity/m-p/798628#M39271CatPaws2022-02-25T16:14:16ZRe: Merging/Combining
https://communities.sas.com/t5/New-SAS-User/Merging-Combining/m-p/796457#M32990
<P>I had a mistake on my end. I did not know that a merge was case-sensitive. They have merged, however, I am getting this error:</P><P>WARNING: Multiple lengths were specified for the BY variable County by input data sets. This might<BR />cause unexpected results.<BR />NOTE: There were 159 observations read from the data set WORK.ONE.<BR />NOTE: There were 778604 observations read from the data set WORK.TWO.<BR />NOTE: The data set WORK.COMBINED has 778604 observations and 17 variables.<BR />NOTE: DATA statement used (Total process time):<BR />real time 0.49 seconds<BR />cpu time 0.46 seconds</P><P> </P><P>When I try to switch them around, the Warning goes away, but it adds additional observations to my data set. (See below)</P><P>NOTE: There were 778604 observations read from the data set WORK.TWO.<BR />NOTE: There were 159 observations read from the data set WORK.ONE.<BR />NOTE: The data set WORK.COMBINED has 778618 observations and 17 variables.<BR />NOTE: DATA statement used (Total process time):<BR />real time 0.48 seconds<BR />cpu time 0.46 seconds</P><P> </P><P> </P>Wed, 16 Feb 2022 05:51:18 GMThttps://communities.sas.com/t5/New-SAS-User/Merging-Combining/m-p/796457#M32990CatPaws2022-02-16T05:51:18ZRe: Merging/Combining
https://communities.sas.com/t5/New-SAS-User/Merging-Combining/m-p/796447#M32987
<P>Here are some observations from my two data set (separated by the yellow column). The data set on the Left has a FIPS code & 2013 code assigned to each County. The data set on the right has multiple observations, and what I need to do is assign the FIPS code and 2013 code to each county on the right. For example, all observations that have Bartow county will also have a FIPS code of 13015 and a 2013 code as 2.</P><P> </P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="CatPaws_0-1644983030631.png" style="width: 400px;"><img src="https://communities.sas.com/t5/image/serverpage/image-id/68507iA3E591CEA58D3A9F/image-size/medium?v=v2&px=400" role="button" title="CatPaws_0-1644983030631.png" alt="CatPaws_0-1644983030631.png" /></span></P><P> </P><P> </P><P> </P>Wed, 16 Feb 2022 03:49:59 GMThttps://communities.sas.com/t5/New-SAS-User/Merging-Combining/m-p/796447#M32987CatPaws2022-02-16T03:49:59ZRe: Merging/Combining
https://communities.sas.com/t5/New-SAS-User/Merging-Combining/m-p/796440#M32984
<P>I tried to code you suggested and got this: </P><P>NOTE: The data set WORK.SORTED has 0 observations and 4 variables.<BR />NOTE: DATA statement used (Total process time):<BR />real time 0.03 seconds<BR />cpu time 0.01 seconds</P><P> </P><P>I should note that there are not multiple states, there is only one State. One data set has multiple variables that include the state and county, and the other data set also has the state and county. I need to match the FIPS Code and the 2013 Code to each county listed in my first data set. Does this make more sense?</P>Wed, 16 Feb 2022 03:11:22 GMThttps://communities.sas.com/t5/New-SAS-User/Merging-Combining/m-p/796440#M32984CatPaws2022-02-16T03:11:22ZRe: Merging/Combining
https://communities.sas.com/t5/New-SAS-User/Merging-Combining/m-p/796435#M32982
<P>When I merge them, some are blank, and I know that to be incorrect because the blanks one have a county listed.</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="CatPaws_0-1644978962907.png" style="width: 400px;"><img src="https://communities.sas.com/t5/image/serverpage/image-id/68505i21F8D5E6E04222D8/image-size/medium?v=v2&px=400" role="button" title="CatPaws_0-1644978962907.png" alt="CatPaws_0-1644978962907.png" /></span></P><P>proc sort data=Z out=One;<BR />by County;<BR />run;<BR />proc sort data=X out=Two;<BR />by County;<BR />run;<BR />data Combined;<BR />merge One (in=a) Two (in=b);<BR />by County;<BR />run;</P><P> </P>Wed, 16 Feb 2022 02:37:29 GMThttps://communities.sas.com/t5/New-SAS-User/Merging-Combining/m-p/796435#M32982CatPaws2022-02-16T02:37:29ZMerging/Combining
https://communities.sas.com/t5/New-SAS-User/Merging-Combining/m-p/796425#M32979
<P>I have two excel files I need to merge. I need to add the FIPS Code and 2013 Code to my data set. The variable they have in common is County and State. However, they each have a different number of observations, so when I try to merge them, it is distorted. I need to add the FIPS Code and the 2013 Code to each County in my dataset, how do I do this?</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="CatPaws_0-1644976507770.png" style="width: 251px;"><img src="https://communities.sas.com/t5/image/serverpage/image-id/68504iEE92D091B21A82BE/image-dimensions/251x124?v=v2" width="251" height="124" role="button" title="CatPaws_0-1644976507770.png" alt="CatPaws_0-1644976507770.png" /></span></P><P> </P>Wed, 16 Feb 2022 01:56:26 GMThttps://communities.sas.com/t5/New-SAS-User/Merging-Combining/m-p/796425#M32979CatPaws2022-02-16T01:56:26ZRe: If and Where statements
https://communities.sas.com/t5/New-SAS-User/If-and-Where-statements/m-p/796298#M32976
<P>When I do them separately, it runs correctly, it's just when I put them together in the same statement I get the error.</P>Tue, 15 Feb 2022 15:33:46 GMThttps://communities.sas.com/t5/New-SAS-User/If-and-Where-statements/m-p/796298#M32976CatPaws2022-02-15T15:33:46ZIf and Where statements
https://communities.sas.com/t5/New-SAS-User/If-and-Where-statements/m-p/796289#M32972
<P>I'm trying to only keep certain observations in my data set, but when I do the IF statements, it is reporting no observations. Basically, I only want to keep observations that are considered confirmatory or presumptive, but I get the SAS error below. Why is it converting the column to numeric?</P><P> </P><P>data All;<BR />set xx;<BR />If Highest_Evidence eq 'Confirmatory' or 'Presumptive';<BR />run;</P><P> </P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="CatPaws_0-1644938425540.png" style="width: 400px;"><img src="https://communities.sas.com/t5/image/serverpage/image-id/68484i0E0F7F96D92895ED/image-size/medium?v=v2&px=400" role="button" title="CatPaws_0-1644938425540.png" alt="CatPaws_0-1644938425540.png" /></span></P><P> </P>Tue, 15 Feb 2022 15:22:07 GMThttps://communities.sas.com/t5/New-SAS-User/If-and-Where-statements/m-p/796289#M32972CatPaws2022-02-15T15:22:07ZProc Freq is duplicating responses
https://communities.sas.com/t5/New-SAS-User/Proc-Freq-is-duplicating-responses/m-p/796175#M32962
<P>Hi!</P><P>I had an issue with SAS converting my numeric variables to character variables when imported from excel. To go around that, I saved it as a CSV then imported it. Now, I am doing a proc frequency on a character variable, and SAS is duplicating those variables. See pic below! On my spread sheet, I only have Female, Male, and Unknown, however, why are they being duplicated?</P><P><span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="CatPaws_0-1644882855929.png" style="width: 400px;"><img src="https://communities.sas.com/t5/image/serverpage/image-id/68465i25AF5591618E6FA9/image-size/medium?v=v2&px=400" role="button" title="CatPaws_0-1644882855929.png" alt="CatPaws_0-1644882855929.png" /></span></P><P>P.S How can I get UNKNOW to display the full name (UNKNOWN)?</P><P> </P>Mon, 14 Feb 2022 23:58:21 GMThttps://communities.sas.com/t5/New-SAS-User/Proc-Freq-is-duplicating-responses/m-p/796175#M32962CatPaws2022-02-14T23:58:21Z