Using a GLM model to predict the response factor from a fixed factor
古いコメントを表示
I want to use a generalized linear model, with the fraction of the people going to a pub(first column) as the response and the discount level (second column) as a fixed factor, to see if the model is significantly different than a null model.
g = fitglm(a(:,1),[a(:,2),a(:,3)],'linear','distr','binomial','link','probit')
I got the following results from the analyis;
Generalized linear regression model:
probit(y) ~ 1 + x1
Distribution = Binomial
Estimated Coefficients:
Estimate SE tStat pValue
________ _________ _______ ________
(Intercept) -1.4245 0.64976 -2.1923 0.028356
x1 0.00651 0.0071339 0.91255 0.36148
35 observations, 33 error degrees of freedom
Dispersion: 1
Chi^2-statistic vs. constant model: 0.869, p-value = 0.351
Does this mean that there is a significant difference between the null model and the GLM?, And the 'fraction of people going to the pub' can be predicted using a linear model with varying access levels? Why there is a large degree of freedom, eventhough i only have 4 'discount levels' ?Data is provided for a reference.
Any help will be appreciated..
3 件のコメント
Hari krishnan
2021 年 10 月 14 日
Jeff Miller
2021 年 10 月 14 日
It is difficult to understand what you are asking.
- The "fraction of people" column in the Excel file has only 4 different values (also, it is strange that the value in this column is always 25*Pub_name).
- You say there are only 4 discount levels but there are many more than four values in the discount levels column of the excel file.
- The fitglm command references 3 columns of 'a' but your description only mentions 2 variables.
- It is not clear how 'a' relates to the excel file. Maybe the column labels are wrong in the Excel file?
If you really only have four discount levels, maybe the simplest thing to do is to compute and compare the average fraction at each discount level?
Hari krishnan
2021 年 10 月 15 日
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Linear Predictive Coding についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
