Recently in the SAS Community Library: SAS' @Sundaresh1 highlights a sometimes overlooked task when applying document embeddings for purposes of similarity-based search. Normalisation of vectors helps obtain relevant matches.
The IBM Data Science certification course is one of the most popular data analytics programs on the market today. It is offered by IBM through Coursera and it helps students build data science and machine learning skills through 10 online courses. IBM Certification Malaysia (lernix.com.my)
... View more
선형회귀에서 최선의 직선 y = mx +b 을 찾기 위해서 실제 값과 예측 값이 최소가 되는 방법을 사용합니다.
https://ko.wikipedia.org/wiki/%EC%84%A0%ED%98%95_%ED%9A%8C%EA%B7%80
최적의 직선을 찾기 위해서 회귀모형의 적합도 지표가 필요합니다.
적합도 지표는 SST = SSR + SSE 라는 개념을 사용합니다.
https://www.researchgate.net/figure/Visualization-of-SSE-SSR-SST_fig17_322398615
■ SST (Total Sum of Squares); 총변동
개별 y의 편차 제곱합으로, 관측값에서 관측값의 평균을 뺀 결과의 총 합의 제곱을 의미한다.
이는, 전체에 대한 변동성을 나타냅니다. 전체 데이터의 총 변동령을 의미합니다.
각 데이터 값이 평균에서 얼마나 벗어나 있는지를 나타냅니다.
■ SSR(Sum of Squares due to Regression); 회귀 제곱합
SSR은 회귀 제곱합으로 예측값(y hat)에서 관측값(y)의 평균을 뺀 결과의 총합을 의미합니다.
직선에 대한 변동성을 의미하며 분석을 통해 설명이 가능한 수치입니다.
회귀 직선이 데이터의 변동을 얼마나 잘 설명하는지를 의미합니다.
예측값(y hat)은 회귀모델에 의해서 예측된 값을 의미합니다.
■ SSE(Sum of Squared Redisuals)
위의 식을 잔차 제곱의 합 RSS(Residual Sum of Squares) 라고 합니다.
실제 관측값(y)와 예측값 사이의 차인 잔차(residual)의 총합을 의미합니다.
위 식에서 y는 실제 데이터 값을 의미하고, ˆy(y hat)은 y = mx + b 단순 선형회귀 식에서 예측값을 의미합니다.
즉, RSS은 회귀식 추정값과 관측값의 평균 간 차이인 회귀 제곱합을 의미합니다.
예측값과 실제 관측값의 차이가 있을 수 있으나 회귀식으로는 설명할 수 없는 설명 불가능 수치를 의미합니다.
오차에 대한 변동성을 의미하고, 해당 값이 작을수록 좋은 모델입니다.
■ R^2 (R Square)
R Square는 결정계수로 회귀 분석에 사용하는 수치로 회귀 모델의 성능에 대한 평가 지표를 의미합니다.
회귀 모델에서 독립변수가 종속변수를 얼마나 잘 설명하는지 보여주는 지표입니다.
결정계수가 높을수록 독립변수가 종속 변수를 잘 설명한다라는 의미입니다.
sashelp 라이브러리에 있는 class 데이터를 사용해서 Simple Linear Regression 예시로 최적의 직선을 찾으려고 합니다.
몸무게(weight)와 키(Height)를 사용해 단순 선형 회귀 분석을 수행합니다.
proc reg data=sashelp.class;
model Weight = Height;
run;
quit;
종속변수 Weight와 독립변수 Height를 사용하여 회귀 모델을 추정합니다.
즉, 키에 따른 몸무게 변화를 예측하는 선형식을 예측합니다.
회귀계수(Parameter Estimates)를 통해 추정한 회귀식은 다음과 같습니다.
위 식은 키가 1증가할 때 마다 몸무게가 3.90 증가한다라는 것을 의미합니다.
결정계수(R Square)값은 0.7705로, 이는 모델이 데이터 변동을 77.05% 설명한다라는 의미입니다.
1에 가까울수록 모델이 데이터를 잘 설명하는 것으로 해당 모델은 높은 설명력을 가진다라고 할 수 있습니다.
... View more
Hello, everyone
It is not uncommon that we have to control more than one time-dependent variable in a Cox regression model. A SAS support PDF document teaches two methods to code for a time-dependent Cox model, but, with only one time-dependent variable adjusted (link: https://support.sas.com/resources/papers/proceedings12/168-2012.pdf).
The first method involves constructing a special data set for the time-dependent variable data and the example is for only one time-dependent variable. It does not teach what to do if there is more than one such variable.
The second method is more advanced, termed "programming statment method". It has only one record for each individual, compared with the first method which has multiple records for each individual.
I wonder how to code for the Cox model if there are 2 or more time-dependent variables, by both method 1 and 2. Thank you very much.
Tom
... View more
I am trying to understand how filevar= option is used in infile statement. I am able to understand that a different file each time (varying file, filevar) will be given to read and it is read sequentially. But I am not able to understand the exact syntax. I am sharing the syntax below which I am trying.
filename qtr1 "path";
filename qtr2 "path";
filename qtr3 "path";
data new;
infile temp filevar = qtr1;
input A B C D;
run;
A B C D are four columns in .dat file qtr1, qtr2 and qtr3 and they are getting read properly without filevar= option. But when I am using filevar=option, the error is shown that "Invalid physical name."
I request to kindly guide me about this. Thanks in advance.
- Dr. Abhijeet Safai
... View more
Hello again, I prepared my plans in SAS Data Studio, I can see them in my SAS Drive, but when I try to open them I get an error message 'You attempted to open an item which is currently unsupported' can anyone tell me what it means? Also, if anyone could let me know what I should select when saving the new plan I created in SAS Data Studio so I can work on it in my Explore and Visualise Save As Actions -> source table or saved table Change source table New job? If anyone knows where to find an explanation of what they all mean or maybe a tutorial where it is covered? I will be grateful. Many thanks!!
... View more