06-16-2021
Quantopic
Obsidian | Level 7
Member since
06-25-2016
- 24 Posts
- 4 Likes Given
- 0 Solutions
- 0 Likes Received
-
Latest posts by Quantopic
Subject Views Posted 1129 12-29-2018 07:30 PM 1370 03-15-2018 09:27 AM 1396 03-15-2018 07:52 AM 5550 08-24-2017 09:30 AM 5565 08-24-2017 05:56 AM 5577 08-24-2017 03:27 AM 5594 08-23-2017 07:29 PM 5596 08-23-2017 07:25 PM 5654 08-23-2017 06:07 AM 2255 08-01-2017 06:20 AM -
Activity Feed for Quantopic
- Posted Built-in probability distribution in PROC GENMOD on New SAS User. 12-29-2018 07:30 PM
- Tagged Built-in probability distribution in PROC GENMOD on New SAS User. 12-29-2018 07:30 PM
- Tagged Built-in probability distribution in PROC GENMOD on New SAS User. 12-29-2018 07:30 PM
- Posted Re: Correct for Heteroskedasticity with PROC REG on SAS Programming. 03-15-2018 09:27 AM
- Posted Correct for Heteroskedasticity with PROC REG on SAS Programming. 03-15-2018 07:52 AM
- Tagged Correct for Heteroskedasticity with PROC REG on SAS Programming. 03-15-2018 07:52 AM
- Tagged Correct for Heteroskedasticity with PROC REG on SAS Programming. 03-15-2018 07:52 AM
- Posted Re: Modelling data using inflated beta regression and PROC NLMIXED on Statistical Procedures. 08-24-2017 09:30 AM
- Posted Re: Modelling data using inflated beta regression and PROC NLMIXED on Statistical Procedures. 08-24-2017 05:56 AM
- Liked Re: Modelling data using inflated beta regression and PROC NLMIXED for Rick_SAS. 08-24-2017 05:51 AM
- Posted Re: Modelling data using inflated beta regression and PROC NLMIXED on Statistical Procedures. 08-24-2017 03:27 AM
- Posted Re: Modelling data using inflated beta regression and PROC NLMIXED on Statistical Procedures. 08-23-2017 07:29 PM
- Liked Re: Modelling data using inflated beta regression and PROC NLMIXED for StatDave. 08-23-2017 07:26 PM
- Posted Re: Modelling data using inflated beta regression and PROC NLMIXED on Statistical Procedures. 08-23-2017 07:25 PM
- Posted Modelling data using inflated beta regression and PROC NLMIXED on Statistical Procedures. 08-23-2017 06:07 AM
- Tagged Modelling data using inflated beta regression and PROC NLMIXED on Statistical Procedures. 08-23-2017 06:07 AM
- Tagged Modelling data using inflated beta regression and PROC NLMIXED on Statistical Procedures. 08-23-2017 06:07 AM
- Tagged Modelling data using inflated beta regression and PROC NLMIXED on Statistical Procedures. 08-23-2017 06:07 AM
- Tagged Fitting exponential distributed data and overlaying empirical with theoretical data on SAS Programming. 08-01-2017 06:21 AM
- Tagged Fitting exponential distributed data and overlaying empirical with theoretical data on SAS Programming. 08-01-2017 06:21 AM
-
Posts I Liked
Subject Likes Author Latest Post 1 3 1 1
01-02-2019
10:20 AM
No. The assumption is that the residuals (errors) are distributed according to the specified distribution. For a discussion and examples, see the article "On the assumptions (and misconceptions) of linear regression."
... View more
03-15-2018
09:27 AM
Thanks for replying @Miracle, but I cannot do that! I need to correct it by applying the heteroscedasticity-consistent parameter estimates. I can doit by using another PROC too.
... View more
08-24-2017
10:11 AM
Based on the description at the beginning of the paper, it seems they are fitting something similar to this example from the Proc FMM documentation.
http://support.sas.com/documentation/cdl/en/statug/68162/HTML/default/viewer.htm#statug_fmm_examples01.htm
In any regard, FMM will give you estimates of the mixing probabilties directly (or they can be modeled using additional effects with the PROBMODEL statement0.
... View more
08-15-2017
06:48 PM
Thanks. This is helpful
... View more
08-01-2017
11:49 AM
You've generated random Exp(theta) data. A better way is to compute the Exp(theta) PDF (density) and overlay that. You can do it with PROC SGPLOT, but the easiest way is to use the ODS graphics that are automatically produced by PROC SEVERITY or PROC UNIVARIATE. Try submitting
ODS GRAPHICS ON;
before you run the PROC SEVERITY code and you should automatically get a histogram and a fitted density curve, as shown below:
data exponential (keep = x);
call streaminit(12345);
theta = 7;
do i = 1 to 200;
x = theta * rand("Exponential");
output;
end;
run;
ods graphics on;
proc severity data=exponential;
loss x;
dist exp;
run;
... View more
06-16-2017
08:39 AM
I totally agree with @Rick_SAS . and I do remember Rick has written a blog about this question.
Search Poisson at Rick's blog, you will find . or @Rick_SAS could point you the URL .
Back to your question. Yes. You can do this but you need change data structure.
x y
7 2
5 6
...
-->
name value
x 7
x 5
....
y 2
y 6
.....
after that ,run KS test.
proc npar1way
edf
data = dataset;
class name
var value ;
exact ks;
run;
... View more
06-15-2017
10:14 AM
1 Like
Please supply sample data and code that show what you are trying to accomplish.
The title of this topic includes the phrase "using simulation", but you do not mention simulation in your question. The typical simulation approach to estimate a p-value is
1. Compute a statistic for the observed data
2. Simulate a sample from a known population that is appropriate for the observed data. (aka, simulate from the "null distribution.")
3. Compute the same statistic for the simulated data.
4. Repeat Steps 2-3 many times.
5. Compare the observed statistic to the distribution of the statistics on the simulated samples. The Monte Carlo p-value is the proportion of simulated statistics that are more extreme than the observed statistic.
The same technique is used to estimate a p-value for a bootstrap distribution. For a simulation example, you can see the article on using Monte Carlo simulation to estimate the p-value for the chi-square test.
... View more
03-21-2017
11:26 AM
Example input data and the desired result go a long way towards letting us figure out the issues.
Provide your existing dataset, or a sample, or something with the same variable names and types that has the same behavior if your data is sensitive, as a data step. Instructions here: https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712 will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the {i} icon or attached as text to show exactly what you have and that we can test code against.
Also provide an example of the desired outpu for that example data.
The way you are using LAG is very likely why things only work for the first record. LAG inside a condion, like
ELSE IF _N_ GT 1 THEN DO;
BR = LAG(ACCOUNT);
is much more complex then you may think.
Please look at the results of this code:
data start;
input x y;
datalines;
1 2
3 4
5 6
;
run;
data new;
set start;
if _n_=1 then br=500;
else if _n_ gt 1 then do;
br = lag(x);
put _n_= br=;
end;
run;
Lag maintains a separate queue for each instance of the function. So when it is inside a condition as you used the first time lag is encountered then there is no previous value. So the values you are seeing for your BR are not in the sequence you want. And you are complicating things by using an apparently calculated variable, account, that does not exist in your base data BACKTESTING_H (at least the first time you ran the code).
All bets may be off after the first time you run something like this:
DATA BACKTESTING_H;
SET BACKTESTING_H;
as you have changed your previous data, possibly so much that running other code later to address the original logic may not work at all.
... View more
01-16-2017
03:02 PM
Anytime, it's why we're here as a community!
Happy coding!
Chris
... View more
07-03-2016
10:34 PM
Like this?
data HAVE;
do VAR1= 1 to 1e3;
VAR2=ranuni(0);
VAR3=ranuni(0);
output;
end;
run;
%macro percentiles(k);
proc univariate data = HAVE noprint;
var VAR1 VAR2 VAR3 ;
output out = PERCENTILES
pctlpts = %do i=1 %to 100;&i %end;
pctlpre = VAR1_ VAR2_ VAR3_;
run;
data WANT;
set HAVE;
if _N_=1 then set PERCENTILES;
%do i=0 %to 99;
if %if &i=0 %then .; %else VAR1_&i; < VAR1 <=VAR1_%eval(&i+1) then VAR1_IN_PCT&i =1;
if %if &i=0 %then .; %else VAR2_&i; < VAR2 <=VAR2_%eval(&i+1) then VAR2_IN_PCT&i =1;
if %if &i=0 %then .; %else VAR3_&i; < VAR3 <=VAR3_%eval(&i+1) then VAR3_IN_PCT&i =1;
%end;
drop VAR1_1--VAR3_100;
run;
%mend;
%percentiles;
... View more
06-25-2016
12:17 PM
It looks like you are trying to imitate the Getting Started example for the CLUSTER procedure. That's fine, but PROC CLUSTER is slightly more complex than the simpler FASTCLUS procedure, which perform k-means clustering. Try this example to get started. If you need tree-based models, you can revisit PROC CLUSTER later:
proc fastclus data=sashelp.iris out=Clust maxclusters=3;
var SepalWidth SepalLength PetalWidth PetalLength;
ID species;
run;
proc sgscatter data=Clust;
matrix SepalWidth SepalLength PetalWidth PetalLength / group=cluster;
run;
... View more