Asked how many columns there are on an exam. I hastily put 3, then 2, and both were graded incorrect. What am I missing?
Datasets don't have "columns", they have VARIABLES.
The output from the PROC CONTENTS is showing that STORM_SUMMARY has 12 variables.
Related
When asking for help with Power BI, what is the best way to add sample data to the question?
What is the best way to show the relationship between tables?
If the sample data is fairly limited in scope, you should type post it as copyable tables similar to this:
Date ID Value
1/2/2018 101 A
1/8/2018 102 B
1/9/2018 101 B
If the tables and relationships are fairly large and/or complex, then a link to a PBIX file helps us reproduce the issue much more quickly.
The relationships are probably best shown as a screenshot of the Relationships tab from the desktop app. Please also write what columns the relationships are on if it's not clear.
Regarding how to add sample data the most simple way is in my opinion to use a DAX table constructor.
Depending on if you are on a non-American or American machine semicolon (;) is used as separator instead of colon (,), while colon is used as a decimal separator in non-American and dot (.) in American.
American:
{
(1.5, DATE(2017, 1, 1), CURRENCY(199.99), "A"),
(2.5, DATE(2017, 1, 2), CURRENCY(249.99), "B"),
(3.5, DATE(2017, 1, 3), CURRENCY(299.99), "C")
}
Non-american:
{
(1.5; DATE(2017; 1; 1); CURRENCY(199.99); "A");
(2.5; DATE(2017; 1; 2); CURRENCY(249.99); "B");
(3.5; DATE(2017; 1; 3); CURRENCY(299.99); "C")
}
Then it is easy to add this data to a model by just using the New Table-function under the Modeling-tab.
[
And simply pasting the data there.
The downside of this way is that the columns will be named Value1 Value2... ValueN. If this is a big issue one could use DAX DATATABLE in basically the same way as described above.
For sample data in a PBIX file, the easiest way is using the Enter Data feature. You can copy in rows & columns from Excel etc, but the data is self-contained within the PBIX file.
I have two variables in 2 separate datasets in sas. Both have a primary key of Customer_Id and another column say LVR . One dataset has old values for the LVR Column. The other one has values from the new calculation for the same column.
I need to show the differences between both on a graph.
I tried to merge them and then tried proc gplot to plot the two LVRs.
Merged dataset looks something like this :
Cust_id LVR_new LVR_old
111 1 2
222 2 .
333 5 4
The dataset containing LVR_new is almost twice in size (number of rows) than the one containing LVR_old.We got more customers qualifying post the new calculations.
The merged dataset has 3046778 observations and 3 variables.
I tried to use proc gplot using the code below:
proc plot data=djia;
plot LVR_old*LVR_new = Cust_id;
run;
This has been running since long so i don't expect the results are going to be very useful.
Can anyone please suggest how can I achieve this. I need to showcase the differences between the two datasets on a graph to be able to show the shift in the results.
Thanks!
Why not use PROC TTEST? There are some ODS GRAPHICS plots that PROC TTEST makes.
Your problem looks exactly liked the paired comparisons example in the documentation.
http://support.sas.com/documentation/cdl/en/statug/67523/HTML/default/viewer.htm#statug_ttest_examples03.htm
proc ttest;
paired LVR_old*LVR_new;
run;
I am working in SAS Enterprise guide on a line of code that is supposed to read the number of observations in a dataset. The dataset contains 3 rows (observations).
I write the following line of code to get the number of observations and store it in the number_observations variable:
call symputx("number_observations", put(attrn(dsid, "nobs"),best.));
However, instead of getting a result of 3, this line returns 9 for me
Any idea what is happening? I should maybe also note that I manually edited this table (it used to have 9 rows).
Use nlobs instead of nobs. nlobs gives the number of logical observations, honoring any records marked for deletion.
There are some situations where nlobs will return -1 if it doesn't know the number of observations. My favorite countobs paper is http://www2.sas.com/proceedings/sugi26/p095-26.pdf.
I want to split by large dataset randomly into two new dataset in the ratio of 70% - 30%.
Basically I need to allocate 70% of random values from large dataset to the newdataset1 and 30% of the random values from largedataset to the newdataset2.
Can you please help with a SAS code that will help me achieve it.
A dummy code will really help..
Proc SQl or SAS statement. Anything will work with me.
For complex sample design (like stratified randomization, e. g.) PROC SURVEYSELECT is a way to go, as #Keith said.
But for just a simple random splitting RANTBL-function will do the trick:
data newdataset1 newdataset2;
set have;
flag=rantbl(-1, 0.7, 0.3);
if flag=1 then output newdataset1;
else output newdataset2;
run;
How can I combine two rows to get one row?
![This is the example][1]
I believe you are looking for DATA UPDATE:
http://support.sas.com/documentation/cdl/en/basess/58133/HTML/default/viewer.htm#a001329151.htm
Example (not sure of your dataset names):
DATA dset3;
UPDATE dset1 dset2;
BY region;
RUN;